7
2
I managed to generate a PNG image with a fractal.
The image is 65,536 pixels high and 65,536 pixels wide. It’s too big to be decoded into memory and displayed. It has probably a lot of unused space near the borders and I want to trim it to significantly reduce its area.
I tried GIMP and GraphicsMagick, but GIMP froze my computer and GraphicsMagick failed to allocate enough memory for the image.
I use Linux and I have 16GB of RAM. The compressed image is 6.2MB in size.
Can I trim the borders without loading the image fully into memory?
FWIW, in the end I used my school's server but I still want to know the answer.
1“It has probably a lot of unused space near the borders and I want to trim it to significantly reduce its area.” How do you know that’s the case? And can you edit your question to provide the actual storage size of the image? Like how many MB (or GB) is it? – JakeGould – 2019-04-12T22:37:45.427
I know that because I ran the program to generate the fractal in different sizes. The resolution of the image is based on the number of iterations given as input and it's as small as possible while including the whole fractal and being easily calculatable. – matj1 – 2019-04-12T23:18:15.590
Maybe this could work? https://stackoverflow.com/q/1905421/1922095
– Brian Z – 2019-04-13T17:02:50.177Why not splitting and conquerring. Divide the image in 3x3 and process the borders then merge back to one. ImageMagick should do – splaisan – 2019-04-13T17:32:07.317