0

I want to put red background (layer 2) on my green object (layer 1). It all looks smooth but after I save as PNG or JPG, black border appears around my green object. How do I get rid of this black border ?

PS. In my photoshop screenshot below, it looks like there's black border too. But in real there's no black border. Image size is 900x900 pixel. I need to use the picture for image processing later so I can't have any other color except for my red & green value.

What I have tried but still fail :

  1. Save as PNG
  2. Save for Web and Devices in PNG24
  3. Save for Web and Devices in PNG2 & unchecked transparency option
  4. Flatten the image before export to PNG
  5. Try to change to color mode into Indexed color and then export it

Here's the file.

enter image description here

Zoom :

enter image description here

This picture from the photoshop window is taken with my phone. Zoomed in 1400% and the edges are still sharp. enter image description here

8
  • Could you provide the file?
    – LeoNas
    Sep 20, 2018 at 16:14
  • sure. I'll post the link to it.
    – raisa_
    Sep 20, 2018 at 16:16
  • @LeoNas posted.
    – raisa_
    Sep 20, 2018 at 16:33
  • Hi. Welcome to GDSE. The image link you posted is 938 x 938px, so if the original was 900 x 900, it seems to have been resampled, and I guess that is what has messed it up by blurring the pixels. Resampling degrades images.
    – Billy Kerr
    Sep 20, 2018 at 19:17
  • @BillyKerr Hi, I rechecked the file. I believe it's still 900x900. Please check this.
    – raisa_
    Sep 20, 2018 at 20:11

2 Answers 2

1

I have downloaded your file, and tried to save it in the five ways you mention. I can't reproduce the problem.

The black border you are experiencing must come from scaling the image.

Are you sure that the image you save is the exact same size as the original psd?

If you are sure of the dimensions, then where are you opening the resulting image?

If you open it in a web browser and zoom in, the browser will scale the image using bicubic interpolation by default, which will cause a blurred edge.


EDIT:

In your screenshot it is obvious that the image has been upscaled.

Your original image is aliased with jagged edges and only red and green pixels. In the screenshot there is about 30 pixels of intermediate tones for 1 original pixel. There isn't just a "black border" - the image has been upscaled using some kind of bicubic interpolation. Since you are sure that it doesn't happen in Photoshop it must happen when you upload or manipulate the image in Picasa. When and how, I can't know (maybe you are applying the image to a larger image and Picasa automatically resizes the image?). I don't understand why you want/need to do image processing in Picasa, when you have access to Photoshop though.

14
  • Hi, thanks ! I believe it is not because of scaling the image. I open my image in image viewer by the way, using Picassa. But what makes me 100% sure the black border is in there, after I use the image as an input for my image processing, there are more than 2 values (red - 255,0,0 and green (0,255,0) detected.
    – raisa_
    Sep 20, 2018 at 20:05
  • and the output from the image processing also shows the black border exactly on the edge of the image.
    – raisa_
    Sep 20, 2018 at 20:08
  • Isn't Picasa a web page? What sort of image processing are you talking about?
    – Wolff
    Sep 20, 2018 at 20:15
  • Is the black border visible if you open the exported png in Photoshop?
    – Wolff
    Sep 20, 2018 at 20:16
  • Have you checked the pixel dimensions of the output from your image processing? Are they the same as the original image?
    – Wolff
    Sep 20, 2018 at 20:17
0

I just got the answer. Thanks for nayhem_jr, original post on Reddit here.

  • Export the image using Save for Web and Devices
  • Make sure the image scaling is at 100%, because unwanted color values will appear due to interpolation. I should save the image at 100% scaling. (My default was also 100%)
  • Then this, Choose Quality = Nearest Neighbor (my default setting was Bicubic)

enter image description here

This works like a charm ! The black lines aren't there anymore.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.