public static void main(String[] args) { DefaultImageRender r = new DefaultImageRender(); Img.source(randomPixels(200, 70, Color.WHITE)) .text("Hello World") .color(Img.Random.darkColor()) .makeNoise() .setMaxLines(7) .setMaxLineWidth(3) .pipeline(r.optionalA) .writeTo("/tmp/1/x.png"); Img.source(randomPixels(200, 70, Color.WHITE)) .text("Hello World") .color(Img.Random.darkColor()) .makeNoise() .setMaxLines(7) .setMaxLineWidth(3) .pipeline(r.optionalB) .writeTo("/tmp/1/y.png"); } }
public static void main(String[] args) { DefaultImageRender r = new DefaultImageRender(); Img.source(randomPixels(200, 70, Color.WHITE)) .text("Hello World") .color(Img.Random.darkColor()) .makeNoise() .setMaxLines(7) .setMaxLineWidth(3) .pipeline(r.optionalA) .writeTo("/tmp/1/x.png"); Img.source(randomPixels(200, 70, Color.WHITE)) .text("Hello World") .color(Img.Random.darkColor()) .makeNoise() .setMaxLines(7) .setMaxLineWidth(3) .pipeline(r.optionalB) .writeTo("/tmp/1/y.png"); } }
@Override public BufferedImage render(String text) { List<? extends Img.Processor> processors = $.random(true, false) ? optionalA : optionalB; return Img.source(backgroundGenerator) .text(text) .color(Img.Random.darkColor()) .makeNoise() .setMaxLines(2 + randInt(5)) .setMaxLineWidth(3) .pipeline(processors) .get(); }
@Override public BufferedImage render(String text) { List<? extends Img.Processor> processors = $.random(true, false) ? optionalA : optionalB; return Img.source(backgroundGenerator) .text(text) .color(Img.Random.darkColor()) .makeNoise() .setMaxLines(2 + randInt(5)) .setMaxLineWidth(3) .pipeline(processors) .get(); }