Setting JPEG 2000 to workaround 359 image corruption bug

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

Moderators: TrackerSupp-Daniel, Tracker Support, Paul - Tracker Supp, Vasyl-Tracker Dev Team, Chris - Tracker Supp, Sean - Tracker, Ivan - Tracker Software, Tracker Supp-Stefan

chrisjj
User
Posts: 392
Joined: Mon Aug 02, 2021 3:47 pm

Re: Setting JPEG 2000 to workaround 359 image corruption bug

Post by chrisjj »

"Image customisation options"?? "through"??

I'll try again.

Is there any option to set JPEG 2000 to be used for all image encoding done by the Explorer "Combine in..." command on PNGs?

Yes or No will do fine, thanks.

Thanks.
Willy Van Nuffel
User
Posts: 2347
Joined: Wed Jan 18, 2006 12:10 pm

Re: Setting JPEG 2000 to workaround 359 image corruption bug

Post by Willy Van Nuffel »

When selecting two or more PNG-files in Windows File Explorer, followed by a right-mouse-click and "Combine in PDF-XChange Editor", there are no "Options..." to define the compression method of these images in the new PDF. After clicking "OK", and verifying the result, it seems to be "ZIP" by default.

But, something that helps to change the compression method of all the (color and grayscale) images in the PDF, is the File > Save As Optimized option.

In the "Optimize PDF"-dialog-box, you can only mark/check the "Images"-option and set the desired compression to JPEG2000.
Make sure to uncheck "Optimize images only if there is a reduction in size" and click "OK" to start the process.
When opening the resulting pdf, the images are indeed compressed with JPEG2000 (tested with build 368.0).

Does that help?

Kind regards.

>
PDF-XChange Editor - Save As Optimized - JPEG2000.png
chrisjj
User
Posts: 392
Joined: Mon Aug 02, 2021 3:47 pm

Re: Setting JPEG 2000 to workaround 359 image corruption bug

Post by chrisjj »

> When selecting two or more PNG-files in Windows File Explorer, followed by a right-mouse-click and "Combine in PDF-XChange Editor", there are no "Options..." to define the compression method of these images in the new PDF.

Sounds like No. Thanks.

> But, something that helps to change the compression method of all the (color and grayscale) images in the PDF, is the File > Save As Optimized option.

Thanks. I'll try it.
User avatar
TrackerSupp-Daniel
Site Admin
Posts: 8438
Joined: Wed Jan 03, 2018 6:52 pm

Re: Setting JPEG 2000 to workaround 359 image corruption bug

Post by TrackerSupp-Daniel »

Hello, all

Thanks willy for the answer and potential workaround, I hope it helps Chris to some degree.

Kind regards,
Dan McIntyre - Support Technician
Tracker Software Products (Canada) LTD

+++++++++++++++++++++++++++++++++++
Our Web site domain and email address has changed as of 26/10/2023.
https://www.pdf-xchange.com
Support@pdf-xchange.com
chrisjj
User
Posts: 392
Joined: Mon Aug 02, 2021 3:47 pm

Re: Setting JPEG 2000 to workaround 359 image corruption bug

Post by chrisjj »

Willy Van Nuffel wrote: Wed May 24, 2023 9:20 pmAfter clicking "OK", and verifying the result
I take it that should read "checking the result".

How may I do that, please?

I'd hoped image Properties, but no:
image.png

Thanks.
User avatar
TrackerSupp-Daniel
Site Admin
Posts: 8438
Joined: Wed Jan 03, 2018 6:52 pm

Re: Setting JPEG 2000 to workaround 359 image corruption bug

Post by TrackerSupp-Daniel »

Hello, chrisjj

If you right click on the image (with the "Edit" tool enabled) and choose "recompress images" you can see which form of compression that particular image is using.

Kind regards,
Dan McIntyre - Support Technician
Tracker Software Products (Canada) LTD

+++++++++++++++++++++++++++++++++++
Our Web site domain and email address has changed as of 26/10/2023.
https://www.pdf-xchange.com
Support@pdf-xchange.com
chrisjj
User
Posts: 392
Joined: Mon Aug 02, 2021 3:47 pm

Re: Setting JPEG 2000 to workaround 359 image corruption bug

Post by chrisjj »

Thanks. That works:
image.png
Since no-one can reasonably be expected to search for this there, could you pass on my suggestion that image property being included in image Properties? Thanks.

Also note that "Compressed image" here:
image(1).png
is not very clear, given both image "states" are compressed, and Before and After would be clearer.
Willy Van Nuffel
User
Posts: 2347
Joined: Wed Jan 18, 2006 12:10 pm

Re: Setting JPEG 2000 to workaround 359 image corruption bug

Post by Willy Van Nuffel »

@chrisjj
It seems like you are using an older version of PDF-XChange Editor than build 362.
In the 'Version History' of build 9.4.362, I see the following:
"Added showing, in Properties Pane, the compression method used in images. (T# 6099)".


@Tracker Support
It might be useful to also have "DPI" and "Size" in the Properties Pane.

Kind regards.
>
PDF-XChange Editor - Image Compression.png
PDF-XChange Editor - Image Compression.png (9.56 KiB) Viewed 1078 times
chrisjj
User
Posts: 392
Joined: Mon Aug 02, 2021 3:47 pm

Re: Setting JPEG 2000 to workaround 359 image corruption bug

Post by chrisjj »

Willy Van Nuffel wrote: Tue Jun 06, 2023 7:00 am It seems like you are using an older version of PDF-XChange Editor than build 362.
I am. Sorry if the "359" in the title was unclear.
Willy Van Nuffel wrote: Tue Jun 06, 2023 7:00 am In the 'Version History' of build 9.4.362, I see the following:
"Added showing, in Properties Pane, the compression method used in images. (T# 6099)".
Excellent. Thanks.
Willy Van Nuffel wrote: Tue Jun 06, 2023 7:00 am It might be useful to also have "DPI" and "Size" in the Properties Pane
Agreed. Or better, adopt as a principle that Properties include all properties.
Willy Van Nuffel
User
Posts: 2347
Joined: Wed Jan 18, 2006 12:10 pm

Re: Setting JPEG 2000 to workaround 359 image corruption bug

Post by Willy Van Nuffel »

chrisjj wrote: Tue Jun 06, 2023 12:29 pm I am. Sorry if the "359" in the title was unclear.
I should have known.

:oops:
User avatar
TrackerSupp-Daniel
Site Admin
Posts: 8438
Joined: Wed Jan 03, 2018 6:52 pm

Re: Setting JPEG 2000 to workaround 359 image corruption bug

Post by TrackerSupp-Daniel »

:)
Dan McIntyre - Support Technician
Tracker Software Products (Canada) LTD

+++++++++++++++++++++++++++++++++++
Our Web site domain and email address has changed as of 26/10/2023.
https://www.pdf-xchange.com
Support@pdf-xchange.com
chrisjj
User
Posts: 392
Joined: Mon Aug 02, 2021 3:47 pm

Re: Setting JPEG 2000 to workaround 359 image corruption bug

Post by chrisjj »

This is PDF-Tools issue, but I'm reporting in this thread because the objective is workaround the issue of this thread.

On this PDF image:
image(2).png
which shows corruption on Acrobat X, this tool which is an attempt to workaround by converting to JPEG 2000:
image.png
fails to convert to JPEG 2000:
image(1).png
Any ideas?
chrisjj
User
Posts: 392
Joined: Mon Aug 02, 2021 3:47 pm

Re: Setting JPEG 2000 to workaround 359 image corruption bug

Post by chrisjj »

chrisjj wrote: Wed May 24, 2023 10:38 pm > But, something that helps to change the compression method of all the (color and grayscale) images in the PDF, is the File > Save As Optimized option.

Thanks. I'll try it.
This failed:
image.png
and likewise:
image(1).png
and likewise:
image(2).png
giving:
image(3).png
Any ideas for a one-operation solution for the whole document?
Attachments
image(4).png
chrisjj
User
Posts: 392
Joined: Mon Aug 02, 2021 3:47 pm

Re: Setting JPEG 2000 to workaround 359 image corruption bug

Post by chrisjj »

Sanitise with this option:
image.png
suffers the same problem, through compressing to JPEG.

How do I change it to use JPEG 2000?
Willy Van Nuffel
User
Posts: 2347
Joined: Wed Jan 18, 2006 12:10 pm

Re: Setting JPEG 2000 to workaround 359 image corruption bug

Post by Willy Van Nuffel »

Like I mentioned before, please uncheck "Optimize images only if there is a reduction in size" and (for preference) only check "Images" in the column at the left. In that manner, other things in your PDF's will be left untouched.

Kind regards and keep us posted if it works correctly in this way.
>
PDF-XChange Editor - Save As Optimized - JPEG2000.png
User avatar
Tracker Supp-Stefan
Site Admin
Posts: 17824
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: Setting JPEG 2000 to workaround 359 image corruption bug

Post by Tracker Supp-Stefan »

:)
chrisjj
User
Posts: 392
Joined: Mon Aug 02, 2021 3:47 pm

Re: Setting JPEG 2000 to workaround 359 image corruption bug

Post by chrisjj »

Willy Van Nuffel wrote: Wed Jun 28, 2023 6:25 amLike I mentioned before, please uncheck "Optimize images only if there is a reduction in size
Oops. Sorry - I overlooked that. Yes, that works EDIT: with no downsampling:

image(1).png
image.png
image(7).png
image(2).png
image(5).png
albeit at the penalty of a huge increase in file size.
Last edited by chrisjj on Thu Jun 29, 2023 9:20 pm, edited 1 time in total.
Willy Van Nuffel
User
Posts: 2347
Joined: Wed Jan 18, 2006 12:10 pm

Re: Setting JPEG 2000 to workaround 359 image corruption bug

Post by Willy Van Nuffel »

@chrisjj

I am glad to read that the recompression via "Save As Optimized" now works correctly for "all" the images in your PDF.
In your screenshots, I see that you are using down-sampling. However earlier in this thread, you looked for a manner to NOT change DPI. Did something made changing your mind about this?


@Tracker Support

1) In comparisons between JPG and JPG2000 I read that compression rates of JPG2000 should be higher than JPG. However (mostly) the resulting file size of images after recompression (from JPG to JPG2000 in PDF-XChange Editor) is higher. Is that normal? Maybe the compression of existing JPG-artifacts are taking up additional space in JPG2000?

2) Earlier in this thread, there was a question from David.P about "up-sampling". Did something happen with this question?
Maybe a feature request?

Kind regards.
User avatar
Tracker Supp-Stefan
Site Admin
Posts: 17824
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: Setting JPEG 2000 to workaround 359 image corruption bug

Post by Tracker Supp-Stefan »

Hello Willy Van Nuffel,

I will ask our devs to take a look at the differences between JPEG and JPEG2000, however we would need to generate a raster from the original compressed JPEG, and then process that to JPEG2000. The JPEG has already added noise, so when recompressing the 'noisier' result - it is expected that any further compression will introduce more noise, and noise takes more space to compress (if it can be compressed at all) compared with e.g. a fully while image that can be compressed to just a few bytes :)

I will also ask if anything has been done with regards upsampling - though again this will effectively be a lossy operation and will not result in a better image quality.

Kind regards,
Stefan
chrisjj
User
Posts: 392
Joined: Mon Aug 02, 2021 3:47 pm

Re: Setting JPEG 2000 to workaround 359 image corruption bug

Post by chrisjj »

Willy Van Nuffel wrote: Thu Jun 29, 2023 8:22 amIn your screenshots, I see that you are using down-sampling.
Thanks for spotting that error. Now corrected.
Willy Van Nuffel wrote: Thu Jun 29, 2023 8:22 am (mostly) the resulting file size of images after recompression (from JPG to JPG2000 in PDF-XChange Editor) is higher. Is that normal?
In my example, 54KB -> 291KB, so definitely does not look right.
User avatar
Tracker Supp-Stefan
Site Admin
Posts: 17824
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: Setting JPEG 2000 to workaround 359 image corruption bug

Post by Tracker Supp-Stefan »

Hello chrisjj,

Please make sure to also check the actual image quality.
I took your original image - made it on purpose very small in "physical" terms - and then asked the Editor to Optimize the file once with JPEG2000 and once with JPEG compression. Both times "Medium" was selected as the preset - however the results are clearly different:
image.png
The JPEG2000 file is bigger - but I would say that it is also with better quality than the much blurrier JPEG.

So the "Medium" for JPEG is not really comparable with the Medium of JPEG2000.

Kind regards,
Stefan
chrisjj
User
Posts: 392
Joined: Mon Aug 02, 2021 3:47 pm

Re: Setting JPEG 2000 to workaround 359 image corruption bug

Post by chrisjj »

Tracker Supp-Stefan wrote: Fri Jun 30, 2023 8:16 am Please make sure to also check the actual image quality.
I did. As expected, I saw no material change.
Tracker Supp-Stefan wrote: Fri Jun 30, 2023 8:16 amthe "Medium" for JPEG is not really comparable with the Medium of JPEG2000.
Please pass on my suggestion this be fixed. Particular care will be needed in retaining existing stored settings.

Thanks.
User avatar
Tracker Supp-Stefan
Site Admin
Posts: 17824
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: Setting JPEG 2000 to workaround 359 image corruption bug

Post by Tracker Supp-Stefan »

Hello chrisjj,

Certainly - will pass that to our devs for review!

Kind regards,
Stefan
chrisjj
User
Posts: 392
Joined: Mon Aug 02, 2021 3:47 pm

Re: Setting JPEG 2000 to workaround 359 image corruption bug

Post by chrisjj »

Thanks S.
User avatar
Tracker Supp-Stefan
Site Admin
Posts: 17824
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: Setting JPEG 2000 to workaround 359 image corruption bug

Post by Tracker Supp-Stefan »

:)
chrisjj
User
Posts: 392
Joined: Mon Aug 02, 2021 3:47 pm

Re: Setting JPEG 2000 to workaround 359 image corruption bug

Post by chrisjj »

Please?
chrisjj wrote: Tue Jun 27, 2023 8:49 pm Sanitise with this option:

image.png

suffers the same problem, through compressing to JPEG.

How do I change it to use JPEG 2000?
User avatar
David.P
User
Posts: 1510
Joined: Thu Feb 28, 2008 8:16 pm

Re: Setting JPEG 2000 to workaround 359 image corruption bug

Post by David.P »

Hello all,
Willy Van Nuffel wrote: Thu Jun 29, 2023 8:22 am 2) Earlier in this thread, there was a question from David.P about "up-sampling". Did something happen with this question?
Maybe a feature request?
For easier reference, this question/request was about automatically increasing (color) resolution first, and only then converting to black+white (when converting and upsampling), in order to maximize the resulting black+white image/drawing resolution:
image.png

Below comparison animation shows the quality difference (after clicking on the image):
1st Upscale then convert to B+W.png
David.P wrote: Wed Oct 12, 2022 9:07 amA use case for me is as follows. I often have (scanned) PDF files with line drawings in e.g. 300 dpi grayscale. I normally need these drawings in pure black and white. If I simply convert the images directly to black and white, part of the image information, or optical resolution, of the original image is lost. The black and white images then become rather pixelated.

Therefore, it would be useful to be able to e.g. double the resolution of the grayscale images first (using "Recompress Images") to 600 dpi, and only then to generate 600 dpi black-and-white images from the upsampled images. When the black-and-white images are then compressed using JBIG, for example, the file size of these high-resolution black-and-white images is still tiny and negligible.

Regarding the second topic:
chrisjj wrote: Thu Jun 29, 2023 9:22 pm In my example, 54KB -> 291KB, so definitely does not look right.
Willy Van Nuffel wrote: Thu Jun 29, 2023 8:22 am In comparisons between JPG and JPG2000 I read that compression rates of JPG2000 should be higher than JPG. However (mostly) the resulting file size of images after recompression (from JPG to JPG2000 in PDF-XChange Editor) is higher. Is that normal?
This has been discussed here, and should be fixed in my opinion:
image(1).png
David.P wrote: Sat Nov 26, 2022 4:44 pmAlso, the compression quality with JPEG2000 seems to be way too high in all quality settings of JPEG2000. [...]

It would be great if the Devs could have a look at the JPEG2000 quality settings and distribute the percentages between "Minimum" and "Maximum" quality to a broader range somewhere between 10% and 95% image quality.

This way, files with lots of color images could be compressed more effectively, using the better compression that JPEG2000 offers over JPEG.
Thanks & best regards
David.P
David.P
PDF-XChange Pro
chrisjj
User
Posts: 392
Joined: Mon Aug 02, 2021 3:47 pm

Re: Setting JPEG 2000 to workaround 359 image corruption bug

Post by chrisjj »

Thanks for that link David. I see the ticket is two years old. I hope my vote for the fix might hasten it.
User avatar
Tracker Supp-Stefan
Site Admin
Posts: 17824
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: Setting JPEG 2000 to workaround 359 image corruption bug

Post by Tracker Supp-Stefan »

Hello chrisjj, David and all,

We've just asked our devs for an update on those J2K tickets, and will update the topics as soon as there is any further feedback!

Kind regards,
Stefan
chrisjj
User
Posts: 392
Joined: Mon Aug 02, 2021 3:47 pm

Re: Setting JPEG 2000 to workaround 359 image corruption bug

Post by chrisjj »

Thanks.
User avatar
Tracker Supp-Stefan
Site Admin
Posts: 17824
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: Setting JPEG 2000 to workaround 359 image corruption bug

Post by Tracker Supp-Stefan »

:)
Post Reply