Jump to content
You must now use your email address to sign in [click for more info] ×

jpg artifacts on cropped and rotated image when exporting pdf to different color space


Recommended Posts

Our customer has notified us that some images on the latest pdfs have noticeable jpg noise on the edges of the image. This noise is very noticeable because the images have white background.

After researching and testing, we have found that this only happens on images that has been cropped and rotated, and only when the pdf is exported to RGB (with the document being made on CMYK), so the "noise" is generated on colour conversion on the cropped image on export.

Attached image shows the noise, which is more noticeable the lower the resolution of the exported pdf.

Steps to reproduce:

  1. Place an image (with white background for better view of the issue) on CMYK document.
  2. Crop the image (in our case, to reduce excessive white area)
  3. Rotate the image
  4. Export to PDF in cmyk, high res (X1A): image has no issues
  5. Export to PDF in RGB, any resolution: image has jpg noise in borders of the crop area

We checked and it also happens converting to Gray and limitless RGB, and the noise disappears when there is no pdf color conversion.

A stopgap solution is to rasterize the image, but this results in an embedded image, unlinking the original, and also doing it on a 4000 image catalogue is a no-no.

Exporting in higher resolution and less compression mitigates the issue, but it is still there.

In our workflow, this is an issue, because we made the design for printing and later export a digital rgb version from the same document for web publishing.

PUBLISHER 2.3.1
MAC OS Sonoma 14.2.1 (23C71)
Checked and reproduced on different computers.

Capturadepantalla2024-01-22alas18_03_39.png.cc6059c32463bdb8b21c1fce3efd585a.png

 

Link to comment
Share on other sites

Hi @Daniel Gibert,

You may need to upload the source 'shovel' image so we can test...

I downloaded a version from 'bigjigstoys.co.uk' as a .webp file, opened in Affinity Photo then exported it as an RGB JPEG file, placed it in a CMYK Publisher 2.3.1 document, cropped and rotated it in Publisher and exported it as both a CMYK X-1a and RGB PDF and I'm not seeing any obvious issues (see attached files)...

Without the source JPEG it's going to be difficult to assess possible causes...

Shovel CMYK X-1a Export.pdf Shovel sRGB Export.pdf

Affinity Designer 2.4.2 | Affinity Photo 2.4.2 | Affinity Publisher 2.4.2
Affinity Designer  Beta 2.5.0 (2415) | Affinity Photo Beta 2.5.0 (2415) | Affinity Publisher Beta 2.5.0 (2415)

Affinity Designer 1.7.3 | Affinity Photo 1.7.3 | Affinity Publisher 1.10.8
MacBook Pro 16GB, macOS Monterey 12.7.4, Magic Mouse

Link to comment
Share on other sites

my 2 cents without much testing:

 

Those issues occur from anti-aliasing at the edges of the rotated image. The edge pixel becomes semi-transparent. In most cases Affinity then mixes the colors with those Fram lower layers, or black in case of transparent areas. This is invisible for high resolution, but becomes visible with very low resolution. The jpeg compression  algorithm create what looks like noise.

To avoid, you may need to add a white backfill rectangle (unrotated). Alternatively, a levels or curves adjustment to boost partial alpha to 100% opaque can repair.

 

Maybe rasterise will mitigate the issue.

A co-factor or trigger is color space conversion.

 

BTW: you can spot the darker seams even in your screenshot called "original image" at the lower right edge.

Inspect the images with Photo and info panel. The background is not pure white.

Mac mini M1 A2348 | Windows 10 - AMD Ryzen 9 5900x - 32 GB RAM - Nvidia GTX 1080

LG34WK950U-W, calibrated to DCI-P3 with LG Calibration Studio / Spider 5

iPad Air Gen 5 (2022) A2589

Special interest into procedural texture filter, edit alpha channel, RGB/16 and RGB/32 color formats, stacking, finding root causes for misbehaving files, finding creative solutions for unsolvable tasks, finding bugs in Apps.

 

Link to comment
Share on other sites

13 hours ago, Hangman said:

Hi @Daniel Gibert,

You may need to upload the source 'shovel' image so we can test...

I downloaded a version from 'bigjigstoys.co.uk' as a .webp file, opened in Affinity Photo then exported it as an RGB JPEG file, placed it in a CMYK Publisher 2.3.1 document, cropped and rotated it in Publisher and exported it as both a CMYK X-1a and RGB PDF and I'm not seeing any obvious issues (see attached files)...

Without the source JPEG it's going to be difficult to assess possible causes...

Here you have the files, both the afpub and the image. The image origin is the same as in your test. a webp file, converted to jpg RGB. I also attached my example pdf with the issue.

Also been further testing and detected an strange thing. The issue is only visible on Adobe Acrobat, but not on Apple's Preview, so the pdf contains something that is only incorrectly rendered on Acrobat. More mystery to the subject.

MDBIG34037_1.jpg

test-spade.afpub test5.pdf

Link to comment
Share on other sites

Hi @Daniel Gibert,

Sorry to be a pain but could you Zip the JPEG file up and re-upload... this is because uploading to the forum applies its own compression and the file you've uploaded is already heavily compressed so it would be helpful to test your source version...

The .webp file I downloaded is not great quality but is already much better than the version you've just uploaded which will all make a difference...

I've just checked your file in Acrobat, Foxit PDF Reader, Preview, Packzview and PDF Toolbox and Preview is the only software where I don't see the issue...

Having said all that, I've just exported your file without any obvious issues (see attached)...

Could you let us know the exact RGB PDF Settings you used which cause the issue...

PDF/X-1a

test-spade-X1a.pdf


PDF (for print) - Adobe RGB

test-spade-adobe rgb.pdf


PDF (for print) - sRGB

test-spade-sRGB.pdf

Affinity Designer 2.4.2 | Affinity Photo 2.4.2 | Affinity Publisher 2.4.2
Affinity Designer  Beta 2.5.0 (2415) | Affinity Photo Beta 2.5.0 (2415) | Affinity Publisher Beta 2.5.0 (2415)

Affinity Designer 1.7.3 | Affinity Photo 1.7.3 | Affinity Publisher 1.10.8
MacBook Pro 16GB, macOS Monterey 12.7.4, Magic Mouse

Link to comment
Share on other sites

32 minutes ago, Hangman said:

Hi @Daniel Gibert,

Sorry to be a pain but could you Zip the JPEG file up and re-upload... this is because uploading to the forum applies its own compression and the file you've uploaded is already heavily compressed so it would be helpful to test your source version...

The .webp file I downloaded is not great quality but is already much better than the version you've just uploaded which will all make a difference...

I've just checked your file in Acrobat, Foxit PDF Reader, Preview, Packzview and PDF Toolbox and Preview is the only software where I don't see the issue...

Having said all that, I've just exported your file without any obvious issues (see attached)...

Could you let us know the exact RGB PDF Settings you used which cause the issue...

 

At your command!

The file is not the greatest quality, but is the one our customer has send to us to work with (Oh! the customers and their files…)

I'm also including capture of the pdf settings we use for digital publishing for this customer. It is just a variation over the app's default "Digital High Quality" pre-setting to lower the resolution and weight. (We tested with many other settings and the issue persist whenever colour conversion is used)

Whatever you need, just ask for it. Thanks four your time!

Captura de pantalla 2024-01-23 a las 9.40.57.png

Archivo.zip

Link to comment
Share on other sites

So this seems to be down to the Quality Slider setting, anything below 100% and you start to see artifacts on the rotated, converted image which doesn't surprise me too much as you are compressing an already heavily compressed image, converting between document colour spaces and because the image is rotated you no longer have perfectly horizontal and vertical image edges...

I completely understand what you mean about customers and their files, been there got the t-shirt but equally the client has to understand the limitations of output quality with the file they've provided you... a couple of phone calls, to their marketing department or the design agency, speaking to the right person who understands the relevance of image quality, in my humble experience, usually results in them suddenly being able to provide either the original image or at least a much higher quality version, e.g., as used on the printed packaging for the 'Short Handled Pointed Space', though I appreciate that still may not be possible...


Quality Slider 100

test-spade-q100.pdf

 

Quality Slider 90

test-spade-q90.pdf

 

Quality Slider 85

test-spade-q85.pdf

 

Quality Slider 80

test-spade-q80.pdf

Affinity Designer 2.4.2 | Affinity Photo 2.4.2 | Affinity Publisher 2.4.2
Affinity Designer  Beta 2.5.0 (2415) | Affinity Photo Beta 2.5.0 (2415) | Affinity Publisher Beta 2.5.0 (2415)

Affinity Designer 1.7.3 | Affinity Photo 1.7.3 | Affinity Publisher 1.10.8
MacBook Pro 16GB, macOS Monterey 12.7.4, Magic Mouse

Link to comment
Share on other sites

7 minutes ago, Hangman said:

So this seems to be down to the Quality Slider setting, anything below 100% and you start to see artifacts on the rotated, converted image which doesn't surprise me too much as you are compressing an already heavily compressed image, converting between document colour spaces and because the image is rotated you no longer have perfectly horizontal and vertical image edges...

 

Thanks @Hangman

Yup, on this case there is no possibility of a better image, not that I didn't try to get one.

Upon your comments, i'm testing the issue using a much higher quality image and the issue persist. The issue happens to the crop image only, despite the image being high resolution jpg with low compression. It seems to be an error on the cropping borders only, as the un-cropped image does not show the issue, neither on the low or the high image.

I've attached the new test for you to check.

Again, thanks.

bucket-test.zip

Link to comment
Share on other sites

18 minutes ago, Daniel Gibert said:

there is no possibility of a better image

You may then want to "surgically" clean up the image first, enhance contrast so that the background is pure white, and smooth out all artifacts.

MacBookAir 15": MacOS Ventura > Affinity v1, v2, v2 beta // MacBookPro 15" mid-2012: MacOS El Capitan > Affinity v1 / MacOS Catalina > Affinity v1, v2, v2 beta // iPad 8th: iPadOS 16 > Affinity v2

Link to comment
Share on other sites

1 minute ago, loukash said:

You may then want to "surgically" clean up the image first, enhance contrast so that the background is pure white, and smooth out all artifacts.

The image has already pure white background and has no artifacts on the area. Also, the issue only happens on the cropping border, but not if the image is uncropped. We have checked with an high resolution high quality image and the issue persist. Whenever the image is cropped and rotated, the pdf generate noise around the cropping area.

We have found tricks to solve it, but that is fine for a couple of images, but not time/economically viable for a whole document with thousands of images to check one by one.

It is an issue just on an specific situation. Image cropped, rotated and PDF with colour conversion. (Yeah, I got to find those kind os situation, evil me :-P)

Thanks anyway for the suggestion.

Link to comment
Share on other sites

Hi @Daniel Gibert,

Interesting, so yes, this does appear to be a vector cropping issue having tested your bucket image which I do feel this is a possible bug and certainly an issue Serif need to look into...

You mentioned in your first post that...

"A stopgap solution is to rasterize the image, but this results in an embedded image, unlinking the original, and also doing it on a 4000 image catalogue is a no-no."

The approach I usually adopt for situations like this would be to rotate and crop the source image in Affinity Photo, exporting to JPEG so:

a) you're not cropping in Publisher and
b) you can keep your image linked in Publihser

Though based on the size and stage you're at with the catalogue you're working on I appreciate may not be an option.

A workaround, if you want to keep your images linked cropping in Publisher would be to place the image in a Picture Frame and then crop the image in the Picture Frame and rotate the Picture Frame rather than using a Vector Crop on the Image itself...

Same Image Placed in a Picture Frame, Cropped and Rotated Using the Same Export Settings

Spade.zip

 

 

spade.thumb.png.bf87609df889f12caeace8801013c534.png

 

Affinity Designer 2.4.2 | Affinity Photo 2.4.2 | Affinity Publisher 2.4.2
Affinity Designer  Beta 2.5.0 (2415) | Affinity Photo Beta 2.5.0 (2415) | Affinity Publisher Beta 2.5.0 (2415)

Affinity Designer 1.7.3 | Affinity Photo 1.7.3 | Affinity Publisher 1.10.8
MacBook Pro 16GB, macOS Monterey 12.7.4, Magic Mouse

Link to comment
Share on other sites

22 minutes ago, Daniel Gibert said:

The image has already pure white background and has no artifacts on the area

Not really. You need to put a larger rectangle behind the cropped image (after being cropped). PDF shows transparent background.

this could also explains why different reader apps give different results, as they treat transparent areas differently.

 

The issue is caused by semi-transparent edge pixels. 

Mac mini M1 A2348 | Windows 10 - AMD Ryzen 9 5900x - 32 GB RAM - Nvidia GTX 1080

LG34WK950U-W, calibrated to DCI-P3 with LG Calibration Studio / Spider 5

iPad Air Gen 5 (2022) A2589

Special interest into procedural texture filter, edit alpha channel, RGB/16 and RGB/32 color formats, stacking, finding root causes for misbehaving files, finding creative solutions for unsolvable tasks, finding bugs in Apps.

 

Link to comment
Share on other sites

29 minutes ago, Hangman said:

A workaround, if you want to keep your images linked cropping in Publisher would be to place the image in a Picture Frame and then crop the image in the Picture Frame and rotate the Picture Frame rather than using a Vector Crop on the Image itself...
 

 

Mmmmmmm. Very interesting.

We usually do not use picture frame due to the speed on which we must work (It is just much faster just to drag the images onto the document and crop if needed. Maybe is just 15 or 20 seconds of time, but multiplied for 4000 images is a lot of time/money for the customer. It happens the same with rotation. It is more time consuming to "hard-rotate" the images in photo than just point and rotate in publisher (Specially when the rotation may need to change often as you add elements to the layout, also "hard-rotating" on Photo could add degradation to the image)

Seeing that picture frame does not generate the issue, now i'm totally sure this is a bug on exporting cropped images. At least we have more possibilities to have in mind for next catalogue, with is due to arrive this week.

Thanks a lot for the insights.

Link to comment
Share on other sites

8 minutes ago, Daniel Gibert said:

We usually do not use picture frame due to the speed on which we must work

  1. place all images
  2. select them all
  3. Layer → Convert To Picture Frame (assign a keyboard shortcut for even faster workflow)
  4. voilà

MacBookAir 15": MacOS Ventura > Affinity v1, v2, v2 beta // MacBookPro 15" mid-2012: MacOS El Capitan > Affinity v1 / MacOS Catalina > Affinity v1, v2, v2 beta // iPad 8th: iPadOS 16 > Affinity v2

Link to comment
Share on other sites

5 minutes ago, loukash said:
  1. place all images
  2. select them all
  3. Layer → Convert To Picture Frame (assign a keyboard shortcut for even faster workflow)
  4. voilà

You are our guardian angel and I learned something new today. Surely this will accelerate things and solve it greatly. Thanks a lot!. We didn't thought on the ability to convert to frame!

We still need to delete the cropping vector after converting (It is preserved inside the frame), but at least is a quick way to clean up the images.

Edited by Daniel Gibert
adding comment
Link to comment
Share on other sites

18 minutes ago, Daniel Gibert said:

Seeing that picture frame does not generate the issue, now i'm totally sure this is a bug on exporting cropped images.

To further prove the point, I've taken an 11 MB, 3,500 px x 3,500 px, 300 dpi PNG file which has a transparent background, opened it in Affinity Photo, added an RGB white background to the layer below the PNG file and then exported as a JPEG file with the Quality Slider set at 100%.

I've then placed the file in Publisher and both 'rotated' (top right) and cropped and rotated the same file using the same PDF export settings and I see the same artifact issue with the version cropped in Publisher (bottom right image)...

flowers.thumb.png.6d9d6c173465f0aec22671e19701290c.png

Affinity Designer 2.4.2 | Affinity Photo 2.4.2 | Affinity Publisher 2.4.2
Affinity Designer  Beta 2.5.0 (2415) | Affinity Photo Beta 2.5.0 (2415) | Affinity Publisher Beta 2.5.0 (2415)

Affinity Designer 1.7.3 | Affinity Photo 1.7.3 | Affinity Publisher 1.10.8
MacBook Pro 16GB, macOS Monterey 12.7.4, Magic Mouse

Link to comment
Share on other sites

4 minutes ago, Daniel Gibert said:

Surely this will accelerate things and solve it greatly.

Another thought, and what I'm often doing:
Set up a large master page for use as a "scratchpad canvas". Like that you could e.g. place all your images there first and convert them to picture frames in one go. Then you just copy the image you need onto the page you want. 

To take it even a step further:
If you use an image multiple times in your layout, and all instances need to appear the same, first convert either the images or subsequently their picture frames to Symbols via the Designer persona.
Then you can use the "scratchpad" as your master image editor. 
Or via Designer persona, you can use the Symbols panel as your "image browser".

Here a "quick'n'dirty" example:
aph_master_page_scratchpad_picture_frames_symbols.thumb.png.f767151d575561a45454c001cdf774ad.png

With a little planning ahead, there are many possibilities to speed up workflows. :) 

MacBookAir 15": MacOS Ventura > Affinity v1, v2, v2 beta // MacBookPro 15" mid-2012: MacOS El Capitan > Affinity v1 / MacOS Catalina > Affinity v1, v2, v2 beta // iPad 8th: iPadOS 16 > Affinity v2

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.