Mobile app version of vmapp.org
Login or Join
Ogunnowo857

: How to fix light edges on resized PNGs from Illustrator? How do you prevent a transparent PNG-24 image from getting light edges when resized without having to force them out using the Webkit

@Ogunnowo857

Posted in: #AdobeIllustrator #Png

How do you prevent a transparent PNG-24 image from getting light edges when resized without having to force them out using the Webkit Optimize Contrast CSS rule?

Clarification: Resizing the image in Chrome results in lighter colored lines inside the letters and shapes near the edges. Those light edges are making the image jagged rather than sharp when sized down to 200px x 50px from its original 350px x 90px size.

Here is a better screenshot of the problem:



(Original image was made using Save for Web on Illustrator)

10.02% popularity Vote Up Vote Down


Login to follow query

More posts by @Ogunnowo857

2 Comments

Sorted by latest first Latest Oldest Best

 

@Megan533

This was driving me so crazy too, I had to sign up to answer it so no-one else feels that frustration...

It appears to be down to the image-render that the browser is using to resize those transparent PNGs that's adding a light edge to it.

I've found adding the following css properties to the image element (or if it's a background image, the element itself) fixes the issue for me in Chrome and Firefox:

img, div.with-resized-background {
image-rendering : -webkit-optimize-contrast
image-rendering : optimizeQuality
}


You can read about more Image Rendering options here.

10% popularity Vote Up Vote Down


 

@Nimeshi706

The image you posted is cut off because your artboard was smaller than the artwork in Illustrator.

You need to either ensure you do not have Clip to Artboard checked in the Same for Web window. Or you need to ensure all artwork falls on the artboard.

Update after question edit

Assuming those white specks are not part of the original image, I would suspect those white portions are a direct result of a Chrome rendering bug and there's no specific way to correct for only Chrome rendering.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme