[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: jpegtran lossless rotation?

On Tue, 25 Jan 2005 17:59:24 +0900, Victor Munoz
<vmunoz@macul.ciencias.uchile.cl> wrote:
> As the previous poster mentioned, after the first transformation, continuing
> with jpegtran yields equivalent results when the circle is completed (l.jpg
> and l360.jpg), but l270.jpg is not the same as pict0069.jpg.

Yes, because the huffman table inside the jpeg header is different.
But that does not mean the DCT image data is different. The same data
is represented different in both files.

> I rotated l.bmp with convert (-90 and 270 degrees, which show no difference
> with 'cmp'), and with gimp (270 degrees). gimp and convert conversions
> differ slightly

That is because djpeg and gimp use a different bitmap format. The
actual pixel data is the same. File sizes don't really say anything
about an image when comparing the output of two different programs.
Windows bitmap files aren't just a raw dump, they still have a header
in front of them. And different header versions exist.

The file sizes of a bitmap produced by djpeg and gimp with the same
input jpg file differ.

> I don't know if these differences are relevant, but I guess, if I want to be
> sure I'm preserving every bit of information :-), then I should use jpegtran to
> rotate and then decode, not decode and then rotate.

It does not matter if you keep the rotated image in a bitmap or other
lossy kind of data format.

So if you want to have the rotated image available in jpeg format,
then you should rotate with jpegtran and not decode, rotate and
encode. As the encoding step is the one which loses some information,
because jpeg uses a lossy compression technique.


Reply to: