Skip to content

Jpeg encoder writes zeroed chrominance quantization table for grayscale images and RGB encoding #1713

Description

@br3aker

Prerequisites

  • I have written a descriptive issue title
  • I have verified that I am running the latest version of ImageSharp
  • I have verified if the problem exist in both DEBUG and RELEASE mode
  • I have searched open and closed issues to ensure it has not already been reported

Description

Current implementation of the JpegEncoderCore writes Block8x8F chroma = default (i.e. zeroed) table to the DQT marker for grayscale images. While ITU spec doesn't forbid it - encoder writes proper marker length so everything works fine but it would be extra nice if there's no 01 + x64 00 bytes in the binary.

This is super unimportant so it can be marked as 'Future' without a doubt.

Activity

  1. br3aker commented on Jul 22, 2021

    @br3aker
    ContributorAuthor

    One little nuance: it can break existing quality estimation if grayscale image have zeroed chroma table and you put some random values or simply a single 1 in the DQT binary for chroma table. While image with such 'corrupted' binary is technically correct - it's grayscale and parser shouldn't even care about chroma quant table even if exists. Current implementation does care and thus destroys quality at re-encoding. Not a very usual thing to encounter in real life and it'll be fixed as part of #1705 anyway.

    Edit: fixed.

  2. added this to the Future milestone on Jul 22, 2021
  3. changed the title [-]Jpeg encoder writes zeroed chrominance quantization table for grayscale images[/-] [+]Jpeg encoder writes zeroed chrominance quantization table for grayscale images and RGB encoding[/+] on Sep 18, 2021
  4. JimBobSquarePants commented on Aug 11, 2022

    @JimBobSquarePants
    Member

    Fixed via #2120

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions