Jump to content

FieldTypeImage strange white outline on transparent png's


bbeer
 Share

Recommended Posts

Hi
I have a very strange error in one of my installation. Transparent png's are being added a white outline on resized images.
We crop the image with width only like
 

$image = $image ? $image->width(400)->url : '';

I am a bid lost here. Anyone having the same issue?

PW 1.0.174
PHP 7.4

Your help is much appreciated!

Link to comment
Share on other sites

Yep. I bet that this are 99.9% transparent pixels from the originals cutout pictures. I mean the originals were photographed on a more or less white background, then it get cropped not by a hard pixel path but by some tool that uses cropping by transparency mask. After that, a shadow drop was added. In the original images the cropped out area is visually not seen, but there are some pixels with a special setting: color white & transparency 100%. It would have been better, if the cutout had be done by hard cropping, 1-2px into the object.

If this currently is resized by GD-lib (PWs default or fallback engine), you may try to switch to ImageMagick engine if the server allows this.

 

  • Like 1
Link to comment
Share on other sites

2 hours ago, bbeer said:

it must be something like this. we have not had this problem before. The thing is that the server is already set to imagick. So I guess there is no other way but to fix the images accordingly.

Thanks a lot!

One last try: You may try to (re)save an original image in Photoshop as 24bit PNG with transparency, just to make sure it definetly get handled by the imagick engine. (There is a small chance that, for example, 8bit PMGs with transparency (or different types of transparency) get not handled by imagick, also if you selected it as first engine. PW does an image inspection and if the current prefered engine is marked not to be able to handle that format combination correct, it will be passed to the next engine in the chain. 24bit PNG with transparency definetly will be handled by imagick. (The last one in the chain always is GD, as fallback).

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...