We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hi , I want to use processing to generate big images (with alpha) for print (16000x16000 pixels). In that process, I use one small PImage (with alpha channel) as a pencil. I need to copy millions of times this small PImage at different places, rotations, sizes, colors and blends in a big PImage with a good anti-aliasing. I don't see any way to do that ... Any idea ? thanks
Answers
use an off-screen graphic created using createGraphics(). this can be a different size to the screen.
you might run into memory issues if it's too big
here's an example using rotated, semi-transparent rectangles rather than images, but i think you probably only need to change / add a couple of lines to get it to do what you want.
Hopefully this will work in pure Processing as long as you have enough RAM available.
However -- if you are specifically rendering for print, then if you encounter memory problems one suggestion I have is tiling and post-processing. This will work even for really extreme requirements (e.g. billions of pixels).
translate()
your sketch so that the current tile coordinates are lined up with the rendering windowWhen you are done you have a directory with 256 tiles. Use some post-processing montage program to assemble your mega-image -- it can write streams of pixels into a file and won't actually need to load everything at once. For example, imagemagick has a 'montage' command that will assemble all the png files in a directory into a 16x16 image like this:
This approach might not work very well if you had lots of shapes all cutting across most of the tiles. However, you describe millions of very small shapes -- for that it should work extremely well.