Jpg compression after crop

Ask for help and post your question on how to use XnView Classic.

Moderators: XnTriq, xnview

drift2006

Jpg compression after crop

Post by drift2006 »

Hi,

I have pictures scanned by Abby finereader and saved as jpg. In order to clean up blurry scan on the edges, I cropped the image within Xnview, and resave the image to jpg, with standard 80 percent quality. To my surprise, the new files are bigger (most of the time) than the original.

For 24 bit color jpg, a lot of time the file gets bigger by about 100-200k, depends on the source. But for grey scale, sometime, it almost double.

So I am wondering what could have happened. Is a possible that Finereader got a better compression routine or Xnview added something new to it.

Appreciate if someone could shred some light on the puzzle.

Thanks a lot

Johnny
User avatar
Olivier_G
XnThusiast
Posts: 1423
Joined: Thu Dec 23, 2004 7:17 pm
Location: Paris, France

Post by Olivier_G »

JPEG is a lossy compression format, which means that when you save an image as JPEG, you actually degrade it compared to what is in memory.
Therefore, if you open an heavily compressed JPEG, you will get an awful image. But this "awful image" is now the original file you are using for further operations. If you decide to save it as JPEG with very high quality, what you are actually asking is for an accurate version of that "awful image" and it will require a larger size.

This is what is happening: Abby Finereader is saving the image with a low quality, then you do some editing in XnView and ask for a high quality => you will lose (again) some information, but less than if you used the same setting as in Abby Finereader.
=> You should probably use a lossless format like PNG from the start and while you are still editing/cropping... and save in JPEG only once at the end: this is more efficient, quality wise.
Olivier
Johnny

re:Jpg compression after crop

Post by Johnny »

Dear Olivier

Thanks a lot for the explanation that clear things up.

However, jpgs saved from Finereader seems fine to the eye when compared with the xnview edit version. (Using xnview-compare and zoomed to max)

Anyway, Xnview is awesome.

Johnny
User avatar
Olivier_G
XnThusiast
Posts: 1423
Joined: Thu Dec 23, 2004 7:17 pm
Location: Paris, France

Re: re:Jpg compression after crop

Post by Olivier_G »

Johnny wrote:However, jpgs saved from Finereader seems fine to the eye when compared with the xnview edit version.
Maybe you should try a lower quality setting in XnView if you are happy with that quality and prefer a smaller filesize. The setting used in Fine reader could actually be well suited.

Another idea to try: make a copy of the JPEG file, open it in XnView, make your selection and try from Menu: Tool>JPEG Lossless transformations>Crop.
It will crop the picture without any JPEG recompression (no loss of quality), directly in the file, although it does it with a 8x8 pixels accuracy only. I don't find this very straightforward, but it may be interesting in your situation.
Remember: try on a copy of your JPEG, as this "JPEG Crop" is applied & saved instantly without any confirmation.
Olivier