The raytracer we're programming generates simple PPM image files. We wrote a little something that generates scene definitions for us, so that we can create an animation with these files.
The initial workflow was opening all files in Photoshop via File > Scripting > Load Files into Stack and exporting the result as a gif. This works well, although the workflow is bumpy. The quality is good, the file size huge.
Now when using ImageMagick to convert from PPM to GIF, the quality of the resulting image is horrible. That is, the quality of single GIF files produced by ImageMagick is already bad. Combining them to a GIF of course does not change that.
Original File (saved as PNG with Photoshop):
GIF (converted from PPM with ImageMagick):
(Especially notice the spots around the point where the light emits)
I just used mogrify -path ../gif -format gif 006.ppm
for that result. I don't really know where to start to tweak this (although I played around with a couple of options from the reference).
Further Notes:
- For reference, here are some example files (original ppm file, ImageMagick gif, …) to play with: https://github.com/kleinfreund/raytracer/tree/master/assets
- Quality is very good when exporting a single image via Photoshop (selective, diffuse dither 100%, no transparency, 256 colors, no meta data)
- Quality is also very good when batch-converting the PPM files to PNG with ImageMagick
- I'm open to other workflows, so I'm fine if you can provide an alternative solution as well
(a little animation of the difference between the two files so the issues are easier to see. by Mark Setchell)