- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
In short, is it supported in UIC or IPP?
I need a lossless rotation of JPEG image.
I need a lossless rotation of JPEG image.
Link Copied
8 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I asked this question a while back, and the answer was no.
I use my own JpegTrans.dll, compiled from IJG, however I not sure if it can handle anything outside baseline jpeg.
See:
ipp-samples\image-codecs\ijg\samples\utils\jpegtran.c
I use my own JpegTrans.dll, compiled from IJG, however I not sure if it can handle anything outside baseline jpeg.
See:
ipp-samples\image-codecs\ijg\samples\utils\jpegtran.c
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
What do you call as lossless JPEG rotation? If that is technique used in IJG library than it is not mathematically lossless and is not necessary faster then just full decode and rotate.
What widely called as JPEG lossless rotate is partial decoding up to final up-sampling and color conversion steps, that is:
1. huffman decode of DCT coefficients
2. dequantization
3. inverse DCT transform (which brings data from frequency domain back to time domain and produceimage pixels)
- here is the point where it is possible to rotatepixel data before the final step, which is up-sampling (if needed) and color conversion (if needed)
First, the only mathematically lossless operation here is huffman decoding.
Second, performance of IPP implementation of up-sampling and color-conversion functions reduce difference in time required to that "lossless rotate operation" and just naive full decoding and rotate.
Regards,
Vladimir
What widely called as JPEG lossless rotate is partial decoding up to final up-sampling and color conversion steps, that is:
1. huffman decode of DCT coefficients
2. dequantization
3. inverse DCT transform (which brings data from frequency domain back to time domain and produceimage pixels)
- here is the point where it is possible to rotatepixel data before the final step, which is up-sampling (if needed) and color conversion (if needed)
First, the only mathematically lossless operation here is huffman decoding.
Second, performance of IPP implementation of up-sampling and color-conversion functions reduce difference in time required to that "lossless rotate operation" and just naive full decoding and rotate.
Regards,
Vladimir
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Vladimir,
I should perhaps said "reversible" instead of "lossless" and clarified that I mean 90, 180 and 270 rotation and flipping.
As far as I know JPEGTRAN does not perform dequantization and IDCT, but instead transforms MCU blocks, AC coefficient matrices, and changes chroma subsampling orientation.
Lossless crop is also possible as long as you crop along MCU boundaries.
Finally, chrominance channels can be discarded for simple and fast grayscale conversion without recompression.
You might want to read through this carefully:
http://www.impulseadventure.com/photo/lossless-rotation.html
Full decompression and rotation is fast enough for display, but I want to be able to save the rotated file without the loss of quality associated with full JPEG recompression.
I should perhaps said "reversible" instead of "lossless" and clarified that I mean 90, 180 and 270 rotation and flipping.
As far as I know JPEGTRAN does not perform dequantization and IDCT, but instead transforms MCU blocks, AC coefficient matrices, and changes chroma subsampling orientation.
Lossless crop is also possible as long as you crop along MCU boundaries.
Finally, chrominance channels can be discarded for simple and fast grayscale conversion without recompression.
You might want to read through this carefully:
http://www.impulseadventure.com/photo/lossless-rotation.html
Full decompression and rotation is fast enough for display, but I want to be able to save the rotated file without the loss of quality associated with full JPEG recompression.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hm, do you mean jpegtran do all these reversible flipping in frequency domain?
Vladimir
Vladimir
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sure, that's the whole point.
If you don't believe me, try it and compare results of conventional rotation with recompression and reversible rotation. There are a lot of programs supporting reversible transforms nowadays.
If you don't believe me, try it and compare results of conventional rotation with recompression and reversible rotation. There are a lot of programs supporting reversible transforms nowadays.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Perhaps you should specify that you want rotation angles be x90 degrees. Though it could be lossless for 45 degree increments too with a little more work. You can not do it for an abitrary angle.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You are wrong in this statement. Lossless jpeg rotation means only huffman decoding, DCT rotation/mirror, huffman encoding.
To put it simply, no new jpeg artifacts are introduced with lossless rotation.
You can repeat lossless rotation infinitely without destroying the image.
The only issue are the right and bottom borders, because they are not on an 8x8 boundary.
If the original image is modulo 8x8, rotation/mirror is purely lossless.
To put it simply, no new jpeg artifacts are introduced with lossless rotation.
You can repeat lossless rotation infinitely without destroying the image.
The only issue are the right and bottom borders, because they are not on an 8x8 boundary.
If the original image is modulo 8x8, rotation/mirror is purely lossless.
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page