Enhance Scans - deskew changes

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

mCHSNUg5Pz8cPap
User
Posts: 218
Joined: Wed Aug 04, 2021 6:36 pm

Enhance Scans - deskew changes

Post by mCHSNUg5Pz8cPap »

I don't know if this is the same issue or not, but deskew blurs the text on pages.
Here is a sample file that needs to be deskewed.
Test File.pdf
.
I deskewed it using the enhance pages dialog and it resulted in noticeably blurred text. Here is a recording showing the settings I used and the result.
PDFXEdit_YnXlSa7wxB.gif
.
One more thing to note is that the same thing happens if I just use the deskew command alone without accessing it through the enhance pages dialog, which means this problems seems to be specific to the deskew command.
You do not have the required permissions to view the files attached to this post.
Features I really want:
1. Fully customizable toolbars: https://forum.tracker-software.com/viewtopic.php?p=167585
2. Ability to draw curved lines: https://forum.pdf-xchange.com/viewtopic.php?p=178335
User avatar
Stefan - PDF-XChange
Site Admin
Posts: 19868
Joined: Mon Jan 12, 2009 8:07 am

Re: Enhance PDF feature is lacking

Post by Stefan - PDF-XChange »

Hello mCHSNUg5Pz8cPap,

Yes - the Deskew effectively creates a new image. It can not just rotate the initial image object unfortunately and a new image has to be created and when it is generated with a lossy compression like JPEG you get the further blurring.

Kind regards,
Stefan
mCHSNUg5Pz8cPap
User
Posts: 218
Joined: Wed Aug 04, 2021 6:36 pm

Re: Enhance PDF feature is lacking

Post by mCHSNUg5Pz8cPap »

Stefan - PDF-XChange wrote: Wed May 07, 2025 10:41 am Hello mCHSNUg5Pz8cPap,

Yes - the Deskew effectively creates a new image. It can not just rotate the initial image object unfortunately and a new image has to be created and when it is generated with a lossy compression like JPEG you get the further blurring.

Kind regards,
Stefan
The image in the file initially has these properties:
image.png
.
After deskewing, the image has these properties:
image(1).png
.
The image started as jpeg. Why is the replacement image compressed with ZIP, larger in size, and fuzzier? It sure seems like something is amiss here.
You do not have the required permissions to view the files attached to this post.
Features I really want:
1. Fully customizable toolbars: https://forum.tracker-software.com/viewtopic.php?p=167585
2. Ability to draw curved lines: https://forum.pdf-xchange.com/viewtopic.php?p=178335
User avatar
Daniel - PDF-XChange
Site Admin
Posts: 11036
Joined: Wed Jan 03, 2018 6:52 pm

Re: Enhance Scans - deskew changes

Post by Daniel - PDF-XChange »

Hello, mCHSNUg5Pz8cPap

Yes, this is expected, As stefan mentioned, deskew needs to recompress the image, and we inherently avoid using lossy compression modes, like JPEG when this happens.

If you specifically need the image to be in JPEG format after this, you can use the recompress images feature to do so.

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
mCHSNUg5Pz8cPap
User
Posts: 218
Joined: Wed Aug 04, 2021 6:36 pm

Re: Enhance PDF feature is lacking

Post by mCHSNUg5Pz8cPap »

Stefan - PDF-XChange wrote: Wed May 07, 2025 10:41 am It can not just rotate the initial image object unfortunately and a new image has to be created and when it is generated with a lossy compression like JPEG you get the further blurring.
Daniel - PDF-XChange wrote: Thu May 08, 2025 10:21 pm Yes, this is expected, As stefan mentioned, deskew needs to recompress the image, and we inherently avoid using lossy compression modes, like JPEG when this happens.
Stefan said lossy compression caused the blurriness, but now you're saying the blurriness is caused by the image being recompressed in a lossless format. I'm not sure I follow these explanations, but okay.

It seems deskew in PDF-XChange gives poor results because it results in a larger and blurrier image. I guess the trade-off becomes whether I want a crooked, small, clear image or a straight, large, blurry image.

Also, the way you and Stefan explained this gives me the impression that perhaps it's impossible to make deskew work better. To test that theory, I checked some free online solutions.

First up is https://www.sejda.com/deskew-pdf. Deskewing produced a straight, small, blurry image. The size of the image stayed the same but it is blurry. In fact, the blurriness is strikingly similar to that produced by PDF-XChange, which makes me wonder if the same algorithm is being used. One thing this does show, however, is that Sejda figured out how to retain the image size and other properties. Here is the finished product.
Test File_Sejda.pdf
.
Next up is https://online2pdf.com/deskew-pdf#. Deskewing produced a straight, slightly larger (508 KB vs 338 KB), clear image. This is a great result. The file size increase is not too bad and, more importantly, it isn't blurry.
image.png
Here is the finished product.
Test File_online2pdf.pdf
.
There are a number of other applications I could test, but they require installing them on my computer, which I don't want to do (don't want an Internet STD from these applications).

I understand if you don't want to improve deskew because you have different priorities. However, because of the blurring, I would just go back to ignoring this feature, which is a shame because there are times when it would come in handy.
You do not have the required permissions to view the files attached to this post.
Features I really want:
1. Fully customizable toolbars: https://forum.tracker-software.com/viewtopic.php?p=167585
2. Ability to draw curved lines: https://forum.pdf-xchange.com/viewtopic.php?p=178335
User avatar
Daniel - PDF-XChange
Site Admin
Posts: 11036
Joined: Wed Jan 03, 2018 6:52 pm

Re: Enhance Scans - deskew changes

Post by Daniel - PDF-XChange »

Hello, mCHSNUg5Pz8cPap
mCHSNUg5Pz8cPap wrote: Fri May 09, 2025 12:50 am Stefan said lossy compression caused the blurriness, but now you're saying the blurriness is caused by the image being recompressed in a lossless format.
These two statments are one in the same. Because of the original formatting, the decompression process is not perfect, that is the first layer of the issue.
Then add in the fact that deskew is inherently a problematic process, which should lead to bloat, unless the original format was lossless.
If you have ever tried to take a photograph of your display screen with a lower quality digital camera, you can get a rough idea of the problematic nature of the deskew process form the "grid" that forms in your image.
EG: (zoom in for the best effect)
PXL_20250509_173756901.MP.jpg
"Raster Image" data is stored in a "grid" format, and when we need to rotate the image by 0.2 degrees, that offsets the grin in a unique way that forces some a "re-blending" of the colors for each "pixel" of the image, and in turn further blur to occur. The more diverse the color range in the image, the more problematic this becomes.

Another way to visualize this is a city with perfectly square city blocks. Imagine you now tried to add continuous side streets on a slight angle, so that they lined up with a current intersection once every 4 blocks (making a new 6 way intersection, with 2 of the streets on very steep angles), and every other street would have an alley/secondary crossing between each of the main intersections. That is effectively what Deskew does to the image. It throws a great deal of confusion into the mix, and trying to "restructure" that city, relocating the structural supports of buildings (colors between two pixels) in a way that nothing "moves", and the old roads remain intact while the new roads are added, is quite the ordeal.

Rounding this post back to the main question, I can only say that this is not a priority focus at the moment, while the team does want to improve here, it is unlikely to see any "large jumps" in output quality anytime soon.

Kind regards,
You do not have the required permissions to view the files attached to this post.
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