Image importing method affects BPC and compression after cropping image in built-in editor

Forum for the PDF-XChange Editor - Free and Licensed Versions

Moderators: PDF-XChange Support, Daniel - PDF-XChange, Chris - PDF-XChange, Sean - PDF-XChange, Paul - PDF-XChange, Vasyl - PDF-XChange, Ivan - Tracker Software, Stefan - PDF-XChange

User avatar
rakunavi
User
Posts: 1675
Joined: Sat Sep 11, 2021 5:04 am

Image importing method affects BPC and compression after cropping image in built-in editor

Post by rakunavi »

Hello all,

As mentioned in the following topic, I prefer CCITT Group 4 compression for black and white images.

When importing image files as base content in PDF-XChange Editor, there are the following six possible ways:

  • Group A
    • File Tab / New Document / From Image Files(s)
    • File Tab / New Document / From Clipboard (Image)
  • Group B
    • File Tab / New Document / From Clipboard (Metafile)
    • Home Tab / Add Image (Content)
    • Home Tab / Add Image (Stamp) -> Flatten Comments
    • Create from Explorer right-click menu
For Group B, there doesn't seem to be any option to specify compression method, but you can use the "Recompress Image" function to convert the compression method to CCITT Group 4 after importing.

Group A and Group B differ in whether the compression method immediately after import was CCITT Group 4, but even in the Group B case, after conversion with the Recompress Image function, all the conditions should be the same. However, when the content images are cropped using the built-in editor for each case, I found that the compression for Group A remains CCITT Group 4 before and after cropping, whereas the compression for Group B unintentionally changes. As shown in the verification, in some cases not only the compression but also the BPC changes.

Please refer to the attached videos that verify the changes in image properties before and after cropping for the cases shown in bold in each group.

  • CapturedVideoWithSampleFiles.zip
  • [00:05] Add "Paint.png" in the "From Image File(s)" dialog. "Paint.png" is the 1-bit monochrome image file used within the topic shown above.
    [00:09] In the "From Image File(s)" options, enable Select Paper Size by Image Size in the New Page Options category. This setting is simply for the sake of visibility and has nothing to do with this verification.
    [00:12] In the Image Compression category, set the Monochrome Compression to CCITT Group 4.
    [00:17] Enable edit mode and verify that the BPC is 1 and the compression is CCITT Group 4 in the properties.
    [00:21] Select an image to open the built-in editor and crop it.
    [00:27] Verify that the BPC is 1 and the compression remains CCITT Group 4 after cropping.
    [00:30] Open file "Paint.png" in Paint.
    [00:32] After selecting all, copy them to the clipboard.
    [00:37] Open "From Clipboard" from "New Document" on the Home tab.
    [00:39] Select Metafile as the clipboard data type.
    [00:42] After enabling edit mode, select an image, verify that the BPC is 1 and the compression is "CCIT Group 4, ZIP" in the properties.
    [00:45] Run "Recompress Image", and change the compression to CCITT Group 4.
    [00:54] Verify that the BPC remains 1 in the properties and the compression is changed to CCITT Group 4.
    [00:56] Select an image to open the built-in editor and crop it.
    [01:03] Checking the properties, the BPC unintentionally changed to 8, and the compression changed to ZIP.
When comparing the first and second halves of the verification, it seems strange that the properties before cropping are exactly the same, but after cropping, the compression method, etc. changes only in the second half of the case.

Also, as mentioned above, there doesn't currently seem to be any option to specify the compression method, etc. for base content images imported by the Group B method. If there is, please let me know how to do so. If there is not, it would be greatly appreciated if an option similar to the one provided for the Group A method could be added to the Preferences dialog, etc.

Hoping that the above information will be of some help to you.
Thank you so much for your continued support.

Best regards,
rakunavi

- PDF-XChange Editor Plus Version: 9.5 build 366.0
- OS Version: Windows 11 Home 22H2 Build 22621.1194
- PC Model: Lenovo IdeaPad C340-15IWL, HP All-in-One 22-c0xx
You do not have the required permissions to view the files attached to this post.
TOP desires for PDFXCE
forum.pdf-xchange.com/viewtopic.php?t=39665 LassoTool
forum.pdf-xchange.com/viewtopic.php?t=38554 CmtGarbled
forum.pdf-xchange.com/viewtopic.php?t=37353 FulScrMultiMon
forum.pdf-xchange.com/viewtopic.php?t=41002 DisableTouchSelect
User avatar
Daniel - PDF-XChange
Site Admin
Posts: 11031
Joined: Wed Jan 03, 2018 6:52 pm

Re: Image importing method affects BPC and compression after cropping image in built-in editor

Post by Daniel - PDF-XChange »

Hello, rakunavi

It is expected that cropping will recompress the image, as the crop function is essentially creating a new image with the new dimensions. Zip compression is typically the most effective and so is our default in such cases, but I will bring this to the attention of the Dev team so that they can look into the possibility of improving this, perhaps trying to offer a "retain compression method where possible" option.

Kind regards,
Dan McIntyre - Support Technician
PDF-XChange Co. LTD

+++++++++++++++++++++++++++++++++++
Our Web site domain and email address has changed as of 26/10/2023.
https://www.pdf-xchange.com
Support@pdf-xchange.com
User avatar
rakunavi
User
Posts: 1675
Joined: Sat Sep 11, 2021 5:04 am

Re: Image importing method affects BPC and compression after cropping image in built-in editor

Post by rakunavi »

Hi Daniel,

Thank you for taking the time to reply.
TrackerSupp-Daniel wrote: Fri Feb 10, 2023 4:52 pm It is expected that cropping will recompress the image, as the crop function is essentially creating a new image with the new dimensions.
If so, then the Group A case, in which the compression method is maintained even after cropping, is a strange behavior. Users will be confused if the results are different even though the conditions before cropping should be exactly the same.
TrackerSupp-Daniel wrote: Fri Feb 10, 2023 4:52 pm Zip compression is typically the most effective and so is our default in such cases
As I said in my first post, it would be great to be able to customize these default settings. PDF-XCE pushes for ZIP in every situation, so it's a pain to get them to change that. When I import monochrome images from the right-click menu in Explorer, they are compressed by ZIP, but since the size is approximately twice as large as CCITT Group 4, I have to recompress the images each time, which is a pain.

Best regards,
rakunavi
TOP desires for PDFXCE
forum.pdf-xchange.com/viewtopic.php?t=39665 LassoTool
forum.pdf-xchange.com/viewtopic.php?t=38554 CmtGarbled
forum.pdf-xchange.com/viewtopic.php?t=37353 FulScrMultiMon
forum.pdf-xchange.com/viewtopic.php?t=41002 DisableTouchSelect
User avatar
Daniel - PDF-XChange
Site Admin
Posts: 11031
Joined: Wed Jan 03, 2018 6:52 pm

Re: Image importing method affects BPC and compression after cropping image in built-in editor

Post by Daniel - PDF-XChange »

Hello, rakunavi

I do agree, there could ccertainly be confusion about this. As I mentioned, the dev team is aware of this and will look into it when they have the time. For now, I am afraid that you will need to continue with your manual workaround.

Kind regards,
Dan McIntyre - Support Technician
PDF-XChange Co. LTD

+++++++++++++++++++++++++++++++++++
Our Web site domain and email address has changed as of 26/10/2023.
https://www.pdf-xchange.com
Support@pdf-xchange.com