Open axyz opened 9 years ago
UPDATE: if I exec this command from a node shell
gm('input.jpg').in('-profile').in('./lib/assets/icc/AdobeRGB1998.icc').resize(null, 900).profile('./lib/assets/icc/sRGB.icc').write('output.jpg', function(err) {console.log(err)})
It seems to work correctly, I'm going to check if it could be a problem with intermediate streams.
gm(gm('scam.jpg').in('-profile').in('./lib/assets/icc/AdobeRGB1998.icc').setFormat('miff').stream()).resize(null, 900).profile('./lib/assets/icc/sRGB.icc').setFormat('jpg').write('ssse.jpg', function(err) {console.log(err)})
this works too...
I've also tried to save using write instead of piping to writeStream, but it is the same. Any clue will be appreciated.
UPDATE: I think I've found the problem: it seems to work correctly without the autoOrient()
Is autoOrient bugged? or do I have to exec it differently?
i have the same problem. the moment i am using autoOrient all jpeg images with AdobeRGB loose saturation. as if i would call noProfile()
obj = gm("./image.jpg")
obj.resize(2000, 2000, '>')
obj.quality(90)
obj.autoOrient()
obj.write("./image-out.jpg")
@axyz did you find a fix?
gm does automatically do strip when calling out-orient:
Replacing obj.autoOrient()
with obj.out('-auto-orient')
should work. Note though that the code mentions it does this because of EXIF tags, but I guess imagemagick should be smart enough to figure this out itself?
Hi, I'm trying to convert an image from adobergb to srgb, for what I've seen the profile instruction only set values on the out array, so I've tried putting the in manually this way:
then with that stream I do some resizing and set with .profile it to sRGB this way:
unfortunately the image exits in sRGB but with pale tones as it ignored the input profile.
If on shell I do
gm convert input.jpg -profile /path/to/adobergb.icc -resize 1000x1000 -profile /path/to/srgb.icc output.jpg
it works correctly and the colors are right.
You can see the actual code on https://github.com/axyz/web-resize/blob/master/lib/web-resize.js
I don't know if the problem could also be in the way I pass streams around, but I don't think so because the resizing and multi-step sharpening work as expected, so it looks like it correctly work on all the stages, only the color are incorrect with adobergb images.
Thanks,