[NBLUG/talk] Forcing a greyscape JPEG into RGB colorspace?

Troy Arnold troy at zenux.net
Mon Jun 14 11:56:05 PDT 2010


On Mon, Jun 14, 2010 at 10:30:18AM -0700, Bill Kendrick wrote:
> 
> So I've got a system that receives images from users
> We then ship those out to a 3rd party.  This 3rd party
> requires that they be JPEGs (easy to convert to) of a
> certain size (easy to check) and in RGB colorspace
> (vs CMYK or Grey).
> 
> I had a great bit of difficulty, and simply threw my hands up,
> when trying to "encourage" a greyscale image (that is, a picture
> that's only grey pixels) to become an RGB colorspace JPEG.
> 
> Every automated tool I tried (libjpeg-progs, ImageMagick,
> possibly others; it's been a while) seemed to ignore my colorspace
> hint, and said to themselves "ah, but it's only grey pixels;
> let's just save it as Grey colorspace!)


I have a couple of scripts floating around that successfully use the
'-colorspace rgb' argument to imagemagick's convert utility although that's
in place to deal with CMYK images.  You might also look at graphicsmagick.

I actually really enjoy writing these kind of image crunching scripts... :)

-t




More information about the talk mailing list