Login  Register

Re: Converting (and saving) to single channel grayscale JPG

Posted by Michael Schmid on Jun 30, 2008; 5:48pm
URL: http://imagej.273.s1.nabble.com/Converting-and-saving-to-single-channel-grayscale-JPG-tp3695717p3695718.html

Hi Andrew,

ImageJ saves also grayscale images as color JPEG - you see this
also when opening such an image in ImageJ. I guess that the
difference in file size between a "true" grayscale JPEG and a
color JPEG with grayscale data is negligible.

My suggestion is using TIFF format - it also avoids artifacts
caused by the lossy JPEG compression.

Michael
________________________________________________________________

On 30 Jun 2008, at 19:01, Andy wrote:

> I need to convert images to single channel grayscale images (such  
> as when
> you use imageMagick to do: convert blah.jpg -colorspace grayscale
> blahgray.jpg
>
> I have tried the following:
> ImageConverter ic = new ImageConverter(img);
> ic.convertToGray8();
> FileSaver fs = new FileSaver(img);
> fs.saveAsJpeg("Blah.jpg");
>
>
> but if I try to use it in matlab, matlab complains that it is not a  
> single
> channel grayscale image.
>
> Any help is greatly appreciated!
> --Andrew