Issue with Dark Pixels in Transparent Resize (Raster)

Corel Paint Shop Pro

Moderator: Kathy_9

pspuser22
Posts: 12
Joined: Sun Jan 23, 2022 12:37 pm
operating_system: Windows 10
System_Drive: C
32bit or 64bit: 64 Bit
Corel programs: PSP Ultimate 2019

Issue with Dark Pixels in Transparent Resize (Raster)

Post by pspuser22 »

Lately whenever i am resizing a transparent image it is applying a hue to the transparent pixels

- I have no Alpha Channels
- I have tried all the different resize formulas
- it has nothing to do with the shadow effect on the opposite side, as the layer is merged before resizing
Original File (Shown for comparison with white background)
base1.png
base1.png (10.69 KiB) Viewed 3305 times
base2.png
base2.png (5.83 KiB) Viewed 3305 times
After 60% Resize, shown with separate white background layer for clarity only, second image with shadow layer remove prior to resize to per-emptively demonstrate that is not relevant
mod2.png
mod2.png (6.19 KiB) Viewed 3305 times
mod3.png
mod3.png (4.54 KiB) Viewed 3305 times
These dark pixels surrounding the leg should not be there. There were never any dark pixels there to begin with just a white outline. Why is PSP putting Dark Pixels around any image I resize? What else to try?

The images are shown with a white background only so you can see the rogue pixels. I merge all visible layers before resizing and the primary image is on a transparent background. As you can see before resizing the border to the transparent section contains only white pixels of varying transparency. After resize, however, they become darker as if the transparency % is converted to a white-black scale percentage for some reason

This behaviour persists around restarts

Of course, if i merge all layers to a white background before resizing then this doesnt happen and the white blends seemlessly - but then the image is no longer transparent which is the whole point.
Jean-Luc
Advisor
Posts: 2177
Joined: Sat Oct 22, 2011 10:50 pm
operating_system: Windows 10
System_Drive: C
32bit or 64bit: 64 Bit
motherboard: ASUS Computer N751J
processor: Intel i7_4710 HQ 2_50GHz
ram: 16GB
Video Card: NVIDIA GeForce GTX 850M
sound_card: NVIDIA High Definition Audio
Hard_Drive_Capacity: 2 Tb
Monitor/Display Make & Model: NVIDIA GeForce GTX 850M
Corel programs: PSP X7, X9, 2018 to 2023
Location: Belgium (French speaking)
Contact:

Re: Issue with Dark Pixels in Transparent Resize (Raster)

Post by Jean-Luc »

Could you post the REAL original file (with transparency)?
THE PAINTSHOP PRO COOKBOOK - GENEALOGY WITH PAINTSHOP PRO
Installed PSP Ultimate: X7, X9, 2018, 2019, 2020, 2021, 2022, 2023
LeviFiction
Advisor
Posts: 6831
Joined: Thu Oct 02, 2008 1:07 pm
operating_system: Windows 10
System_Drive: C
32bit or 64bit: 64 Bit
motherboard: Alienware M17xR4
processor: Intel Core i7-3630QM CPU - 2_40GH
ram: 6 GB
Video Card: NVIDIA GeForce GTX 660M
sound_card: Sound Blaster Recon3Di
Hard_Drive_Capacity: 500GB
Corel programs: PSP: 8-2023
Location: USA

Re: Issue with Dark Pixels in Transparent Resize (Raster)

Post by LeviFiction »

I too would like to see the original file. Or at least know how big the original image was. And how big you're scaling it up?

Also did you try the pick tool? Or just Image -> Resize?

My initial thought is that technically in PSP fully transparent pixels do still have a color. It's 0, 0, 0. So maybe it's sampling and creating an intermediary color from that. But I don't know that's what's happening. I would need to be able to recreate the steps.
https://levifiction.wordpress.com/
pspuser22
Posts: 12
Joined: Sun Jan 23, 2022 12:37 pm
operating_system: Windows 10
System_Drive: C
32bit or 64bit: 64 Bit
Corel programs: PSP Ultimate 2019

Re: Issue with Dark Pixels in Transparent Resize (Raster)

Post by pspuser22 »

LeviFiction wrote: Sun Jan 23, 2022 9:19 pm I too would like to see the original file. Or at least know how big the original image was.
Any size. Literally any size. Any resize results in artifacts like this in PSP 2019 Ultimate only. I'm not generally making massive resizes generally taking something in the 800-2000 pixels wide range and reducing to 400-800 range. The original exemplar was a reduction of about 65% from a 750px start

I've attached a simple circle (originally a vector) which i converted to raster and resized. It caused the artifacts just the same. You can see the exact artifacts in the second file.
LeviFiction wrote: Sun Jan 23, 2022 9:19 pm And how big you're scaling it up?
I'm not scaling it up. I'm scaling it down. Which makes it even more baffling. Losses are expected when scaling up.
LeviFiction wrote: Sun Jan 23, 2022 9:19 pm Also did you try the pick tool? Or just Image -> Resize?
Resizing with the pick tool actually doesn't produce the artifacts and does result in clean white edges, only Image -> Resize does. So - thanks for the suggestion - However, resizing with the pick tool results in lower quality preservation of the original image particularly below 500pixels or so (It seems to lean more towards a pixel resize then a smarter, smoother resize at that point) so at this point i'm just using any common freeware paint program to resize which is annoying but better than having artifacts

circle small.png
Attachments
articfacts.7z
(64.1 KiB) Downloaded 54 times
Jean-Luc
Advisor
Posts: 2177
Joined: Sat Oct 22, 2011 10:50 pm
operating_system: Windows 10
System_Drive: C
32bit or 64bit: 64 Bit
motherboard: ASUS Computer N751J
processor: Intel i7_4710 HQ 2_50GHz
ram: 16GB
Video Card: NVIDIA GeForce GTX 850M
sound_card: NVIDIA High Definition Audio
Hard_Drive_Capacity: 2 Tb
Monitor/Display Make & Model: NVIDIA GeForce GTX 850M
Corel programs: PSP X7, X9, 2018 to 2023
Location: Belgium (French speaking)
Contact:

Re: Issue with Dark Pixels in Transparent Resize (Raster)

Post by Jean-Luc »

pspuser22 wrote: Mon Jan 24, 2022 12:39 am I've attached a simple circle (originally a vector) which i converted to raster and resized. It caused the artifacts just the same. You can see the exact artifacts in the second file.
I see it too. Same behavior in PSP 2022.
The only way to get rid of is to use Pixel Resize.
THE PAINTSHOP PRO COOKBOOK - GENEALOGY WITH PAINTSHOP PRO
Installed PSP Ultimate: X7, X9, 2018, 2019, 2020, 2021, 2022, 2023
pspuser22
Posts: 12
Joined: Sun Jan 23, 2022 12:37 pm
operating_system: Windows 10
System_Drive: C
32bit or 64bit: 64 Bit
Corel programs: PSP Ultimate 2019

Re: Issue with Dark Pixels in Transparent Resize (Raster)

Post by pspuser22 »

Incredible. Clearly this is a major bug with PSP resizing how does it go unnoticed? Freeware browser based editors don't even have this issue and i know earlier versions of PSP were ok. I was using one of the X variants previously with little issue though it may have been older than the ones you have installed

Obviously Pixel resize is not good because it creates bad borders
Jean-Luc
Advisor
Posts: 2177
Joined: Sat Oct 22, 2011 10:50 pm
operating_system: Windows 10
System_Drive: C
32bit or 64bit: 64 Bit
motherboard: ASUS Computer N751J
processor: Intel i7_4710 HQ 2_50GHz
ram: 16GB
Video Card: NVIDIA GeForce GTX 850M
sound_card: NVIDIA High Definition Audio
Hard_Drive_Capacity: 2 Tb
Monitor/Display Make & Model: NVIDIA GeForce GTX 850M
Corel programs: PSP X7, X9, 2018 to 2023
Location: Belgium (French speaking)
Contact:

Re: Issue with Dark Pixels in Transparent Resize (Raster)

Post by Jean-Luc »

pspuser22 wrote: Mon Jan 24, 2022 11:36 pm Incredible. Clearly this is a major bug with PSP resizing how does it go unnoticed? Freeware browser based editors don't even have this issue and i know earlier versions of PSP were ok. I was using one of the X variants previously with little issue
It seems that this is an old bug: the problem is visible in PSP X7 too.
I tested on PSP 8 (Jasc) and the behavior is correct (no grey pixels after reduction in Optimal mode).
THE PAINTSHOP PRO COOKBOOK - GENEALOGY WITH PAINTSHOP PRO
Installed PSP Ultimate: X7, X9, 2018, 2019, 2020, 2021, 2022, 2023
pspuser22
Posts: 12
Joined: Sun Jan 23, 2022 12:37 pm
operating_system: Windows 10
System_Drive: C
32bit or 64bit: 64 Bit
Corel programs: PSP Ultimate 2019

Re: Issue with Dark Pixels in Transparent Resize (Raster)

Post by pspuser22 »

I was previously using X4 I believe without issue. How do we get this resolved?
JoeB
Posts: 2778
Joined: Fri Mar 28, 2008 10:04 pm
operating_system: Windows 8.1
System_Drive: C
32bit or 64bit: 64 Bit
motherboard: LENOVO 4524PE4 ThinkCentre M91p
processor: 3.10 gigahertz Intel Quad Core i5-2400
ram: 8 GB
Hard_Drive_Capacity: 4.6 TB
Corel programs: PSP 9, X7 to 2019, 32 & 64-bit
Location: Canada

Re: Issue with Dark Pixels in Transparent Resize (Raster)

Post by JoeB »

I notice that this has been about dark pixels around the edges of transparent images when resizing. Has this bug any effect or cause any issues with non-transparent layers/images resized down?
Regards,

JoeB
Using PSP 2019 64bit
pspuser22
Posts: 12
Joined: Sun Jan 23, 2022 12:37 pm
operating_system: Windows 10
System_Drive: C
32bit or 64bit: 64 Bit
Corel programs: PSP Ultimate 2019

Re: Issue with Dark Pixels in Transparent Resize (Raster)

Post by pspuser22 »

JoeB wrote: Tue Jan 25, 2022 7:28 pm I notice that this has been about dark pixels around the edges of transparent images when resizing. Has this bug any effect or cause any issues with non-transparent layers/images resized down?
I haven't noticed any, with a merged background and no transparency resizing is fine
pspuser22
Posts: 12
Joined: Sun Jan 23, 2022 12:37 pm
operating_system: Windows 10
System_Drive: C
32bit or 64bit: 64 Bit
Corel programs: PSP Ultimate 2019

Re: Issue with Dark Pixels in Transparent Resize (Raster)

Post by pspuser22 »

So is the thought that there is just no solution to this, PSP is simply broken and the only way around it is to use a different program other than PSP?
Kathy_9
Site Admin
Posts: 2896
Joined: Tue Nov 30, 2010 12:44 am
operating_system: Windows 10
System_Drive: C
32bit or 64bit: 64 Bit
processor: 8th Generation Intel Core i7 8700 3 20 GHz
ram: 16GB
Video Card: NVIDIA GeForce RTX 2060 [6 GB GDDR6 dedicated]
sound_card: NVIDIA High Definition Audio
Hard_Drive_Capacity: 2TB
Monitor/Display Make & Model: HP EliteDisplay E243m 23.8-inch
Corel programs: PSPX2 ~2023; Painter 2018~23
Location: USA
Contact:

Re: Issue with Dark Pixels in Transparent Resize (Raster)

Post by Kathy_9 »

pspuser22 wrote: Sat Jan 29, 2022 12:21 pm So is the thought that there is just no solution to this, PSP is simply broken and the only way around it is to use a different program other than PSP?

Since this is a user to user forum we could only offer speculation as to whether this will be fixed. Your best bet since this seems to be a show-stopper for your workflow would be to contact Corel directly and report the bug. https://www.corel.com/en/support/#corel
PSPX9 | PSP2020 | PSP2021| PSP2022 | PSP2023 & PhotoMirage installed; PSPX | PSPX2 thru PSP2019 owned but not installed
http://www.flickr.com/photos/37153430@N03/
LeviFiction
Advisor
Posts: 6831
Joined: Thu Oct 02, 2008 1:07 pm
operating_system: Windows 10
System_Drive: C
32bit or 64bit: 64 Bit
motherboard: Alienware M17xR4
processor: Intel Core i7-3630QM CPU - 2_40GH
ram: 6 GB
Video Card: NVIDIA GeForce GTX 660M
sound_card: Sound Blaster Recon3Di
Hard_Drive_Capacity: 500GB
Corel programs: PSP: 8-2023
Location: USA

Re: Issue with Dark Pixels in Transparent Resize (Raster)

Post by LeviFiction »

I do have a less-than-desirable option. But it should work most of the time.

The method is simple, and easily scripted to make it faster. In fact I'll include a script
1) Ctrl + A (Select All)
2) Ctrl + F (Float Selection)
3) Delete Floating Selection Layer (don't hit Delete key as that'll just clear the selection) Use the menu options Layers -> Delete or right-click the layer select Delete from the context menu
4) Make a mask from the selection: Layers -> New Mask Layer -> Show Selection
5) Select the original layer, invert the selection, fill with whatever color is most common around the edge.
5) You should now be able to resize without issue as the mask will handle the transparency portion.

Technically with other colors this probably doesn't come up all that often as a big deal because it would only make the edges slightly darker and only shows up to this extreme when decreasing in size.
Attachments
OpacityToMask.zip
(530 Bytes) Downloaded 56 times
https://levifiction.wordpress.com/
pspuser22
Posts: 12
Joined: Sun Jan 23, 2022 12:37 pm
operating_system: Windows 10
System_Drive: C
32bit or 64bit: 64 Bit
Corel programs: PSP Ultimate 2019

Re: Issue with Dark Pixels in Transparent Resize (Raster)

Post by pspuser22 »

I'm not sure what to do with the script but on the surface, masking works when you are resizing a single color object. However its not a great workaround, and whenever you are working with a pre made or multi color selection its relatively useless.

There has to be an underlying cause as to why this software all of a sudden can't properly resize a raster selection. Its almost as if it is assuming the image is on a black background instead of a transparent background - but doing so within the mask layer so you only get the discoloration around the edges - and also why no discoloration occurs when resizing a square selection.
pspuser22
Posts: 12
Joined: Sun Jan 23, 2022 12:37 pm
operating_system: Windows 10
System_Drive: C
32bit or 64bit: 64 Bit
Corel programs: PSP Ultimate 2019

Re: Issue with Dark Pixels in Transparent Resize (Raster)

Post by pspuser22 »

Actually I think i found the issue?

When PSP is resizing raster images and calculating the %Transparency of the new pixel, it is also applying that percentage to the RGB values for that pixel

So in this example you have a non-square image that is completely red (255,0,0). It has no anti-alias so every pixel is at 100% opacity.

Now, you resize the image 50%. Some of the pixels that used to be 100% opacity are now 50% opacity. That SHOULD BE the only change to the image. The opacity. The color should remain 255,0,0.

However, that is not what PSP is doing. PSP is for some reason also applying the new opacity value to the numerical RGB values. So the 50% pixel now has a color of 127,0,0 in RGB. Effectively, the more transparent a pixel becomes when resizing, it is also become more 'black'. This is why the effect is greatest when you have a light/white image as any resizing will have a noticeable ring around it of dark semi-transparent pixels that shouldn't be there, and never were before.

Is there a way to correct this calculation?
Post Reply