Jump to content

Sharp edges on TRANSPARENT PNG after resize


2hoch11
 Share

Recommended Posts

I have a transparent PNG with a soft shadow. After the API-rescale there ist a sharp edge between the soft shadow and the opaque parts. I already disabled the sharpening in the backend, in addition to this I disabled the sharpening in the template:

$options = array(
    'sharpening' => 'none' // none, soft, medium, strong
);

…and yes, I removed the variations, I reuploaded the image several times…

I know there is no option to select the resizeing algorithm, but that would be really nice. The best angorithm I have ever met is Lanzcos (u can even get rid of moirés). However, not even Photoshop has the Lanzcos algorithm.

So back to the problem: has anyone a solution? I attached a screenshot for comparison reasons, and a part of the "original" Image.

If nothing works: I will make a "sandwitch"... meaning, an extra image for the shadows and an extra image for the opaque/solid part

resized.png

original.png

Link to comment
Share on other sites

I have seen something like this in the past. It looks like the source image is not clean clipped. You may open it in photoshop and hover over the first pixel beneath the object. I bet it has color 255,255,255 but with opacity. Otherwise IMagick would take the gray color value of the shadow. If you have this as photoshop layers, please check the clipping of the object(s) and maybe correct it. Also a good thing is to add some monochrome noise to the shadows only.

 

Also you may try setting "defaultGamma" => -1, in $config->imageSizerOptions in the site/config.php. And try with forceEngine GD, just to see how it works out in comparison to IMagick. But I'm sure that the issue belongs to the above explained somehow unclean clipping of the objects.

Link to comment
Share on other sites

Hi horst, thank you for the fast reply. Default gamma is now -1 and I clipped off 1 pixel from the image. As you can see, there is no difference... how can I force PW to use GD instead of iMagick?

And meanwhile Photoshop shows always #000000 in transparent areas… ?

3d-1px-clip.1440x0.png

Link to comment
Share on other sites

$options = ["forceEngine" => "ImageSizerEngineGD", "forceNew" => true];  // also add forceNew = true while testing !!
$pageimage->size(100, 200, $options);

I think it should be this. But not 100% sure if the spelling is correct.

  • Thanks 1
Link to comment
Share on other sites

59 minutes ago, horst said:

$options = ["forceEngine" => "ImageSizerEngineGD", "forceNew" => true];  // also add forceNew = true while testing !!
$pageimage->size(100, 200, $options);

I think it should be this. But not 100% sure if the spelling is correct.

THIS ist the solution! GD did the job! (syntax is correct). So I guess I will set GD to default… in this project. THANK YOU!

I attached both resized images. The "good" one is GD, the other one is IMagick.

3d-1440x0-GD.png

3d-1440x0-IMagick.png

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...