JPG truecoloer to Grey no reencoding ?
im having some b/W + a few greytones comic pictures. however they are saved as jpeg 24bit truecolor. im wondering since JPG is not storing its as RGB data if it would be possible to strip the color plane and just keep the light intensity aka greytone information without reintroducing new jpeg compression artifacts.
When using commandline tools:
"jpegtran -grayscale image.jpg >image_gs.jpg"
Although it doesn't save much if the image is nearly monochrome to begin with. You might want to use -optimize and -progressive switches as well.
Last edited by T. Hautamäki; 5th May 2014 at 12:23.
Sorry to be so skeptical but are you sure its does not reencode the pictures and introduce more artifacts ?
From the man page:
"jpegtran works by rearranging the compressed data (DCT coefficients), without ever fully decoding the image. Therefore, its transforma-
tions are lossless: there is no image degradation at all, which would not be true if you used djpeg followed by cjpeg to accomplish the
same conversion. But by the same token, jpegtran cannot perform lossy operations such as changing the image quality."
There should be no loss when you're just killing some empty chroma planes, but if the image is actually a colour image and the colours are removed, the result might be worse than decoding the colour image and converting it to grayscale. This is because the artifacts in the colour image might partially cancel themselves out.
There's also jpegcrop, which is basically jpegtran with a simple GUI, sufficient for processing a couple of images.
Last edited by T. Hautamäki; 5th May 2014 at 16:38.
The Following User Says Thank You to T. Hautamäki For This Useful Post:
Thank you i couldn't find the documentation on jpeg trans.
It tried manually testing by jepgtran vs just open the jpg in PSP and change it to greyscale. but the results was different some pixels Blocks was 1.1.1 (RGB 24bit) higher than the other. probably just a roudning error in PSP]s greyscale function
my pictures is closer to pure greyscale. There is a slight difference in tone changing it to hreyscale, but the source scanning is black/white (dithered) or greyscale for sure.
Last edited by SvenBent; 5th May 2014 at 17:18.
JPEG uses YCbCr and ITU-R Rec.601 luma (0.299R+0.587G+0.114B) but if your application uses something else, like Rec.709 luma (0.2126R+0.7152G+0.0722B) then of course conversion results are going to vary.
As for a "difference in tone", that sounds to me like some B&W material has been scanned in colour mode and never properly converted to greyscale. That's likely to produce a tint.
again thank you for the info on the different greyscales.
and yes the Tint is for 24 scanning of BW/graytone soruce. whivh iwhy iwanna conveter it "losslessly" to Greyscale
If you haven't found this one yet, some background info included: