Jump to content

Very poor quality with scaled transparent PNGs


NikNak
 Share

Recommended Posts

Hi there

I'm having troubles with transparent PNGs looking pretty bad when scaled in PW.

The following image has a transparent background:

Original image: 59k

post-1696-0-02913000-1386689327_thumb.pn

Resized image: Quality 90 32k

post-1696-0-17286800-1386689095.png

Resized image: Quality 95 130k

post-1696-0-86093400-1386689171.png

 

Resized image: Quality 10 28k

post-1696-0-50176600-1386689182.png

 

There are black shadows appearing around the edge of any transparent area that isn't fully black. This results in an unusable image, currently. It is happening on all transparent logos I'm uploading.

The code I use is here...

    $logoOptions = array(
      'quality' => 100,
      'upscaling' => 0, 
      'cropping' => 0
    );

    $logoOut = "<img src='{$page->logo->size(180, 180, $logoOptions)->url}' width='180' height='180' />";

The quality setting makes no difference to the corrupting of the transparent edges.

I have tried PNGs output from Illustrator and Photoshop to make sure it wan't to do with the original, and I have tried two different installations on a local and remote server, both on PHP 5.4.

Is this a limitation with GD in PHP?

Does anyone have any suggestions [other than convert your images to jpg :-) ]  ?

Kind regards

Nik

Link to comment
Share on other sites

Thanks v much Martijn for the reply - Raymond Geerts clearly had the exact same issue

That helps a lot -  I'll look into Horst's workaround to see if it helps. 

There is a BUG in GD-Lib with Alpha-Transparency in PNG.

Fingers crossed I'll get it sorted.

Kind regards

Nik

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