Results 1 to 8 of 8

Thread: JPG truecoloer to Grey no reencoding ?

  1. #1
    Member
    Join Date
    Sep 2007
    Location
    Denmark
    Posts
    856
    Thanks
    45
    Thanked 104 Times in 82 Posts

    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.

  2. #2
    Member
    Join Date
    Mar 2014
    Location
    Helsinki, Finland
    Posts
    10
    Thanks
    0
    Thanked 5 Times in 3 Posts
    Yes.

    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.

  3. #3
    Member
    Join Date
    Sep 2007
    Location
    Denmark
    Posts
    856
    Thanks
    45
    Thanked 104 Times in 82 Posts
    Sorry to be so skeptical but are you sure its does not reencode the pictures and introduce more artifacts ?

  4. #4
    Member
    Join Date
    Mar 2014
    Location
    Helsinki, Finland
    Posts
    10
    Thanks
    0
    Thanked 5 Times in 3 Posts
    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.

  5. The Following User Says Thank You to T. Hautamäki For This Useful Post:

    SvenBent (5th May 2014)

  6. #5
    Member
    Join Date
    Sep 2007
    Location
    Denmark
    Posts
    856
    Thanks
    45
    Thanked 104 Times in 82 Posts
    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.

  7. #6
    Member
    Join Date
    Mar 2014
    Location
    Helsinki, Finland
    Posts
    10
    Thanks
    0
    Thanked 5 Times in 3 Posts
    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.

  8. #7
    Member
    Join Date
    Sep 2007
    Location
    Denmark
    Posts
    856
    Thanks
    45
    Thanked 104 Times in 82 Posts
    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

  9. #8
    Member caveman's Avatar
    Join Date
    Jul 2009
    Location
    Strasbourg, France
    Posts
    190
    Thanks
    8
    Thanked 62 Times in 33 Posts
    If you haven't found this one yet, some background info included:
    http://encode.ru/threads/1800-JSK-JP...ined-in-slowmo

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •