Background is, I'm splitting a video (mp4, mov) into PNG frames using FFMPEG, then converting those to jpeg with GraphicsMagick.
So I'm using GraphicsMagick in NodeJS, from here and below is a snippet:
var gm = require('gm').subClass({imageMagick: true});
gm('input.png')
.write('output.jpg', (err) => {
if (err) return console.log(err);
console.log('done');
});
But the output jpeg colour is either washed out, or too dark. See here for the output. The original video is left (mov) and the converted JPEG's are middle and right. The middle one, is the node app running on Heroku and the right image is the node app on my osx machine.
I've read it could be to do with 'profiles' but this doesn't seem to make a difference:
.profile('sRGB.icc')
'sRGB.icc' is a colour profile I've downloaded.
Any ideas?
I've also tried setting the colours amount to 16,777,216, tried setting the bit depth to 8 and 16, tried setting the colourspace to 'rgb' to no avail.
So after a long time and lots of testing and configuring (using Docker builds galore) the issue was that newer builds of FFMPEG render out images with some kind of messed up profile which causes the colour issue.
Reverting back to an older build of FFMPEG (2014 build) solved the issue.