<p>Like the color values, transparency is a piece of information that needs to be stored in an image. A quite common data representation is <code>RGB</code> with the channels red, green, and blue (often 8bit). This only contains color information. Transparency can not be represented by this format. You need to add another channel for that where you can store the transparency information. This extended format would be <code>RGBA</code> where <code>A</code> is the &quot;alpha&quot; channel that represents transparency. This is not a simple &quot;yes&quot; or &quot;no&quot; boolean value, since a pixel can also be partially transparent which creates a color mixture with the background. This is important to understand because the problem in your case is that the converter you used obviously dropped the alpha channel, and recreating it &quot;correctly&quot; is not possible in most cases.</p>
<p>When the program asks you to specify a transparency color, here is what is likely going to happen: The program will add the missing alpha channel and then scan every pixel of the image. If the pixel is of the specified color, it will be set the alpha value to 100% transparent and to fully opaque otherwise. So just &quot;yes&quot; or &quot;no&quot;. Why is this approach problematic?</p>
<p>First, you might have some parts of the same color in your image that shouldn't be transparent. But the bigger problem is usually that the borders will look weird. To avoid visible staircase patterns at shape borders one usually applies some color blending on non-transparent images. For example, a black line on white background gets some grey pixels added so that the steps aren't as obvious anymore. If your image has transparent parts, you will do this blending via the alpha channel instead. The original image you used most likely did this. But when the converter dropped the alpha channel, he just stored the colors resulting from a white background.</p>
<p>So considering that the transparent color just sets exact color matches to transparent and everything else to opaque will give you a lot of lighter, fully opaque pixels at the border that should just be partially transparent. That would be the grey pixels from the mentioned black line. This gets more obvious and disturbing, the darker the background.</p>
<p>What can you do about it? You can either use an editing tool that supports direct editing of the alpha channel to correct all of this manually but the better approach would probably be to convert the original pdf again with a converter that preserves the alpha channel.</p>
<p>Note, that there might be some alpha reconstruction algorithms that handle things a bit smarter than I described them, but this is not as easy as one might think. If it was, there wouldn't be the need for an alpha channel at all.</p>

CC BY-SA 4.0
2022-05-20T12:31:24.687Z
thx for an explanation. Do you know of any such converter?
Igor
CC BY-SA 4.0
2022-05-22T11:33:46.093Z
I seldomly use external tools and code most of the stuff myself, so I can't name a converter that does what you need. If you are willing to code some stuff yourself, I am pretty sure that there are python packages out there that do what you want. [Here is a question on SO](https://stackoverflow.com/q/2693820/6700329) that might help with extracting unmodified images from a pdf. If you don't want to do some coding, maybe our [Software Recommendations site](https://softwarerecs.stackexchange.com/) can help you find a tool. Make sure to read their FAQ before asking ;)
wychmaster
CC BY-SA 4.0
2022-05-20T10:09:09.380Z
2022-05-20T10:09:09.380Z
wychmaster
<p>ALL,</p>
<p>Task: Modify existing OSX cursor</p>
<p>Solution:</p>
<p>Cursors in OSX are stored in PDF format. So, I used an online
converter PDF -&gt; PNG.</p>
<p>Next I modified resulting PNG in Windows Paint and saved it as PNG.</p>
<p>Problem: When looking at the resulting PNG in OSX (Preview app f.e), I
see a white background. I don't see any transparency around my
modified image.</p>
<p>I presume it is a result of the MS Paint saving the image as it
appears on the screen.</p>
<p>Now, how do I convert all those white pixels on background to become
transparent?</p>
<p>I tried to look online, but what I found is the converted will ask me
for a specific transparency color, and I am not sure whether I should
say &quot;white&quot; or something else.</p>
<p>Could someone please help?</p>
<p>TIA!!</p>

CC BY-SA 4.0
2022-05-20T09:06:08.640Z
I am not entirely sure if this question fits in here, as it seems like you are asking for guidance on how to use software tools, which is off-topic on this site. But I will try to answer your question anyway.
wychmaster
<transparency>
Create a transparent PNG
Igor
# Create a transparent PNG

(Asked by: username_0 on 2022-05-11)

ALL,

Task: Modify existing OSX cursor

Solution:

Cursors in OSX are stored in PDF format. So, I used an online
converter PDF -> PNG.

Next I modified resulting PNG in Windows Paint and saved it as PNG.

Problem: When looking at the resulting PNG in OSX (Preview app f.e), I
see a white background. I don't see any transparency around my
modified image.

I presume it is a result of the MS Paint saving the image as it
appears on the screen.

Now, how do I convert all those white pixels on background to become
transparent?

I tried to look online, but what I found is the converted will ask me
for a specific transparency color, and I am not sure whether I should
say "white" or something else.

Could someone please help?

TIA!!

**Tags:** transparency

> **Comments:**
> **username_1**: I am not entirely sure if this question fits in here, as it seems like you are asking for guidance on how to use software tools, which is off-topic on this site. But I will try to answer your question anyway.  

---

## 1 answers

### Answer by username_1 on 2022-05-20. Score: 1

Like the color values, transparency is a piece of information that needs to be stored in an image. A quite common data representation is `RGB` with the channels red, green, and blue (often 8bit). This only contains color information. Transparency can not be represented by this format. You need to add another channel for that where you can store the transparency information. This extended format would be `RGBA` where `A` is the "alpha" channel that represents transparency. This is not a simple "yes" or "no" boolean value, since a pixel can also be partially transparent which creates a color mixture with the background. This is important to understand because the problem in your case is that the converter you used obviously dropped the alpha channel, and recreating it "correctly" is not possible in most cases.

When the program asks you to specify a transparency color, here is what is likely going to happen: The program will add the missing alpha channel and then scan every pixel of the image. If the pixel is of the specified color, it will be set the alpha value to 100% transparent and to fully opaque otherwise. So just "yes" or "no". Why is this approach problematic?

First, you might have some parts of the same color in your image that shouldn't be transparent. But the bigger problem is usually that the borders will look weird. To avoid visible staircase patterns at shape borders one usually applies some color blending on non-transparent images. For example, a black line on white background gets some grey pixels added so that the steps aren't as obvious anymore. If your image has transparent parts, you will do this blending via the alpha channel instead. The original image you used most likely did this. But when the converter dropped the alpha channel, he just stored the colors resulting from a white background.

So considering that the transparent color just sets exact color matches to transparent and everything else to opaque will give you a lot of lighter, fully opaque pixels at the border that should just be partially transparent. That would be the grey pixels from the mentioned black line. This gets more obvious and disturbing, the darker the background.

What can you do about it? You can either use an editing tool that supports direct editing of the alpha channel to correct all of this manually but the better approach would probably be to convert the original pdf again with a converter that preserves the alpha channel.

Note, that there might be some alpha reconstruction algorithms that handle things a bit smarter than I described them, but this is not as easy as one might think. If it was, there wouldn't be the need for an alpha channel at all.

> **Comments:**
> **username_0**: thx for an explanation. Do you know of any such converter?  
> **username_1**: I seldomly use external tools and code most of the stuff myself, so I can't name a converter that does what you need. If you are willing to code some stuff yourself, I am pretty sure that there are python packages out there that do what you want. [Here is a question on SO](https://stackoverflow.com/q/2693820/6700329) that might help with extracting unmodified images from a pdf. If you don't want to do some coding, maybe our [Software Recommendations site](https://softwarerecs.stackexchange.com/) can help you find a tool. Make sure to read their FAQ before asking ;)  

---

