Lossless grayscale JPEG "color" inversion? -


imagemagick can invert colors of jpeg so:

mogrify -negate image.jpg 

however, that's not lossless. intuition says color inversion should doable in lossless fashion, @ least grayscale images, know hardly jpeg. hence questions:

  • is lossless jpeg grayscale inversion possible in theory?
  • if so, libjpeg or other software out there able it?

jpeg encodes images series of entropy coded deltas across mcus (minimum coded units - 8x8 blocks of dct values) , entropy coded quantized dct coefficients within each mcu. inverting pixel values (even if grayscale) involve decoding entropy coded bits, modifying values , re-encoding them since can't "invert" entropy coded dct values. there isn't 1 one matching of entropy coded lengths each value because bits encoded based on statistical probability , magnitude/sign of quantized values. other problem coded dct values exist in frequency domain. i'm not mathematician, can't sure if there simple way invert spatial domain values in frequency domain, think @ best it's complicated , quantization of values interfere simple solution. kind of things can losslessly in jpeg files rotate, crop , less known operations such extracting grayscale image color image. individual pixel values can't modified without having decode , recode mcus incurs "loss" in jpeg quality.


Comments

Popular posts from this blog

how to insert data php javascript mysql with multiple array session 2 -

multithreading - Exception in Application constructor -

windows - CertCreateCertificateContext returns CRYPT_E_ASN1_BADTAG / 8009310b -