[Solved] Clarification of lossless JPEG cropping

The right place to speak and share about your experiences of GraphicConverter
Gernarfle
Posts: 4
Joined: Fri Oct 15, 2021 1:00 pm
Country: United States

[Solved] Clarification of lossless JPEG cropping

Post by Gernarfle »

I would like to interactively crop JPEG photos losslessly, similar to BetterJPEG on Windows.

Reading the manual, I see on p71 that I can enable "Lossless JPEG cropping (if possible)." The manual then refers you to p171, but it's not obvious how this reference relates.

Clarification 1: How do I enable this setting?
I'm pretty sure I need to double-click on the Selection button in the Tools palette, then check "Lossless JPEG Selection/Cropping." The problem is, I don't see the selection snapping to 8 or 16 pixel units, which are required for lossless JPEG cropping. If I make a selection, go back to the Selection option, then click the Apply button, I will see the selection marquee shift, which I assume it's snapping to 8px boundaries, but I can't be sure.

Would this extra step of opening Selection settings and clicking Apply be required each time I want to make a lossless crop?
How do I get the selection to snap properly to 8/16px units? I feel the tool should do this for me automatically, without needing to enable a grid.

Clarification 2: Do I need to change the JPEG decompress method in the settings?
While searching through the Settings, I noticed in Image Formats > JPEG, that "Lossless JPEG cropping is only supported with JPEG 6c," which is NOT the default decompressor. I tried changing this setting, but I didn't notice any change in the selection behavior described above.

So do I need to change the decompress method from TurboJPEG (default) to 6c? If so, this is terribly convoluted.
User avatar
forum_adm
Site Admin
Posts: 1814
Joined: Fri Dec 23, 2016 9:41 am
Location: Germany
Country: Germany
Contact:

Re: Clarification of lossless JPEG cropping

Post by forum_adm »

The lossless cropping is only support by the original JPEG SDK.
So, please check JPEG 6c in the prefs part open/formats/JPEG
1.jpg
1.jpg (112.27 KiB) Viewed 3907 times
Now open the JPEG file.
Double click onto the selection tool icon in the toolbox and check the lossless cropping checkbox. Click onto ok.
2.jpg
2.jpg (127.26 KiB) Viewed 3907 times
Now make oder modify the selection. It will automatically jump onto the 8 or 16 pixel bounds depending onto the file.
3.jpg
3.jpg (58.8 KiB) Viewed 3907 times
Select Save as. Select JPEG as format and click onto options to the lossless settings.
4.jpg
4.jpg (108.89 KiB) Viewed 3907 times
Thorsten
Gernarfle
Posts: 4
Joined: Fri Oct 15, 2021 1:00 pm
Country: United States

Re: [Solved] Clarification of lossless JPEG cropping

Post by Gernarfle »

Thank you for the reply Thorsten, but unfortunately, that's exactly what I have done, yet I'm not seeing the selection marquee snap to 8/16px boundaries when drawing a new selection. I can still crop an image to odd sizes. But as noted in my first post, if I make a selection, open the Selections options dialog, and click Apply, I will see the selection marquee suddenly move (which I assume is snapping to 8/16px boundaries, I just can't be sure).

I'm using GraphicConverter 11.5.2 on macOS 10.14.6.
User avatar
forum_adm
Site Admin
Posts: 1814
Joined: Fri Dec 23, 2016 9:41 am
Location: Germany
Country: Germany
Contact:

Re: [Solved] Clarification of lossless JPEG cropping

Post by forum_adm »

Do you view the image at 100% to see the snapping?

Thorsten
Gernarfle
Posts: 4
Joined: Fri Oct 15, 2021 1:00 pm
Country: United States

Re: [Solved] Clarification of lossless JPEG cropping

Post by Gernarfle »

Yes, I'm viewing at 100%. Here's a video: https://d.pr/v/pgLBKk

Here's the image I'm testing with, a 16x16 grid (but I've tried many other JPEGs).
16pxGrid_256x256.jpg
16pxGrid_256x256.jpg (38.5 KiB) Viewed 3896 times
In the video you can see I'm able to make arbitrary selections, it does not snap to a grid until after I click the Apply button.
User avatar
forum_adm
Site Admin
Posts: 1814
Joined: Fri Dec 23, 2016 9:41 am
Location: Germany
Country: Germany
Contact:

Re: [Solved] Clarification of lossless JPEG cropping

Post by forum_adm »

Please view my short movie at:
https://www.lemkesoft.info/forum_movies/lossless2.mp4

Thorsten
Gernarfle
Posts: 4
Joined: Fri Oct 15, 2021 1:00 pm
Country: United States

Re: [Solved] Clarification of lossless JPEG cropping

Post by Gernarfle »

Thank you for the video. Here's the interesting behavior change I observed:

1. As you saw in my first video, selections were not snapping to 8/16px boundaries when using a free selection, but after I made a selection, then dragged the corners, it started snapping to 8px boundaries, just as in your video. The behavior change is that free selections now snap to 8px boundaries as expected. So I would consider the original behavior a bug, though I haven't tried to reproduce it on another system.

2. When trying to save the cropped JPEG, I'm not seeing the same Options dialog as in your video. Here's a new video: https://d.pr/v/e7amAW

It's worth mentioning, this is a clean install of Graphics Converter, and the only settings/options I've changed are related to lossless JPEG cropping as described here.

EDIT: Ah, I see now. I can't actually perform the crop, the crop happens when doing Save As. I appreciate your app and good documentation, but this workflow comes with a lot of pitfalls.

BTW, I'm able to reproduce issue #1 above. If I do anything to the image, like make a mark with the pencil, then undo, now the selection tool no longer snaps to 8px boundaries. In the documentation, you mention that nothing else can be done to the image in order to do a lossless crop, but I figure the undo stack should have put the image back into an "untouched" state. Instead, I had to re-open the image.

I might suggest creating a separate workflow just for Lossless JPEG cropping which can avoid the extra settings and confusing changes in behavior.
Last edited by Gernarfle on Sun Oct 17, 2021 2:23 am, edited 1 time in total.
User avatar
forum_adm
Site Admin
Posts: 1814
Joined: Fri Dec 23, 2016 9:41 am
Location: Germany
Country: Germany
Contact:

Re: [Solved] Clarification of lossless JPEG cropping

Post by forum_adm »

Many thanks for your feedback.

I will think about an extra workflow.
User avatar
forum_adm
Site Admin
Posts: 1814
Joined: Fri Dec 23, 2016 9:41 am
Location: Germany
Country: Germany
Contact:

Re: [Solved] Clarification of lossless JPEG cropping

Post by forum_adm »

Please download the latest BETA:
http://www.lemkesoft.org/beta.html

The import library does no longer matter. I read now the required v/h values with JPEG 6c in addition.

Also, I simplified the dialog in for the selection:
Screen Shot 2021-10-17 at 19.53.57.jpg
Screen Shot 2021-10-17 at 19.53.57.jpg (166.93 KiB) Viewed 3876 times
Thorsten
matti
Posts: 32
Joined: Sat Dec 31, 2016 12:13 pm

Re: [Solved] Clarification of lossless JPEG cropping

Post by matti »

So in the new Lossless cropping it is no longer necessary to set preference Open > JPEG: JPEG 6c, right?

BTW, what is the difference between TurboJPEG (GC default) and JPEG 6c -- when does it matter which one is selected?
Post Reply