ppmsave produces files jpeg-archive can't handle
I'm using https://github.com/danielgtaylor/jpeg-archive for further compressing jpeg while keeping quality. For that I use jpeg-compare/jpeg-recompress from jpeg-archive. Those two commands take a ppm file as input. Which works perfectly fine when the ppm is produced by imagemagick, but not when I use ppmsave from vips, eg.
$image = \Jcupitt\Vips\Image::newFromFile("f.jpg");
$image->ppmsave("f.ppm");
jpeg-compare then reports
$ /usr/local/bin/jpeg-compare -r -m ssim f.ppm f.jpg
Unsupported bit depth 640!
(the bit depth number is always different)
Are should I report that to jpeg-archive? I see that someone actually started maintaining it again this month
Hello @chregu, sorry, this issue dropped off my radar in the xmas build up and I've only just found it again :(
I tried here and it seems to work:
$ vips copy ~/pics/k2.jpg x.ppm
$ jpeg-compare -r -m ssim x.ppm ~/pics/k2.jpg
SSIM: 0.999998
The error Unsupported bit depth 640! seems to suggest a 16-bit PPM. If I look at the head of my x.ppm I see:
P6
#vips2ppm - Sat Mar 10 18:12:54 2018
1450 2048
255
[binary data]
ie. a regular JPG should just have 255 for the max value.
Anyway, my guess would be that you are doing some other processing which is making a larger bit-depth PPM.