Jump to content

Transparent GIF: Prevent Parts of Image from Being Transparent


Recommended Posts

Hello, everyone, I'm Jack, and I'm using Paint.net 4.1.1 on Windows 10.  I don't use the program much, and I'm a novice with graphics.  I'd just like to get a little assistance with something, if that's all right, please.

I'd like to make a few transparent GIF images.  I know the basics, but I need some advice.  In order to make an image transparent, I select Magic Wand, hold the SHIFT key down, click on the area I want transparent, and then press DELETE.  Then, I re-save the image as a GIF.    Am I correct, so far? 

Some of the documentation I've read on-line says saving to PNG is preferable, but I have not been able to save a transparent image to PNG successfully.  So, I'm sticking with the GIF format.

My question is this:  What is the most practical way to prevent part of the actual image from being made transparent?  One of my images is of a safety razor.  It has a solid white background, but part of the safety razor has some white in it.  Is there a way to prevent that section within the actual image to become transparent? 

I know I can adjust the "threshold," which I've done.  That helps.  But I was hoping I could get some helpful tips about how to fine-tune the image.

With your permission, I'll add the image to this post, with colored arrows pointing to the areas in the image I do not want transparent.  Thank you for any feedback you'd care to give.  I appreciate your help.  J. Danniel

Image to Make Transparent.gif

Link to comment
Share on other sites

Hi @J. Danniel and welcome to the forum!

 

Doing what you want is not easy because of the similarity of colors.

 

Here's what I would do:

 

1.  Use the Magic Wand at the lowest possible threshold without erasing anything inside your razor.

2.  Make a solid black layer below your razor and clean up the area with the Eraser Tool with anti-alias turned off.

3.  Make a new transparent layer in between the razor and black layer. Using the Rectangle Selection Tool, make a slim, long rectangle on the transparent layer.

4.  Switch to Move Selected Pixels Tool and rotate the rectangle and move it into position to align with the handle of the razor as shown below.

4a. Move back to your razor layer and hit Delete.

 

razorhelp_01.png

 

5.  Do this as many times as needed on any straight parts of the razor.  As you can see, looking pretty good.

6.  Re-activate Anti-aliasing and use AA's Assistant twice.   Effects-->Object-->AA's Assistant.

 

razorhelp_02.png

 

7.  Delete the transparent and black layer and Save As a PNG!  You don't want to work with gif unless you're making an animation.

 

razorhelp_final.png

 

 

Now you try so you can work with the file without the red and blue arrows.   (I could have gotten rid of them for you, but I want you to do it) ;)

 

If you need further help, don't hesitate to ask.   ?

 

Edited by lynxster4
Added step 4a.
  • Like 1
Link to comment
Share on other sites

1 hour ago, J. Danniel said:

I've read on-line says saving to PNG is preferable, but I have not been able to save a transparent image to PNG successfully.

 

Make sure the PNG Bit Depth is set to Auto-detect. The bit depth is specified in the Save Configuration menu, which appears as the last step in saving the file.

Link to comment
Share on other sites

You don't need to hold shift when using the magic wand. When you hold shift, it does a "global" selection, which ignores the boundaries between objects/colors. You probably just want to do a regular click. This is also configurable within the toolbar.

The Paint.NET Blog: https://blog.getpaint.net/

Donations are always appreciated! https://www.getpaint.net/donate.html

forumSig_bmwE60.jpg

Link to comment
Share on other sites

This is NOT easy.  The easiest way for me is to use the magic wand, after reducing the threshold, without it affecting the razor itself.  Then, I used the Eraser, and literally scrubbed the white away from the outside area of the razor.    I increased the brush width to take less time doing this.  Then, I zoomed in on the image, reduced the brush width, and fine-tuned the area by scrubbing further.

 

I do not know how I came up with this idea.   Divine intervention, perhaps.

 

It's not perfect, but only because I didn't take more time to fine-tune it further.  You can see the areas I missed.  But it didn't take too long to tweak the image this way, and you know what...for me, it's close enough.  What do you think?

 

 

Razor.GIF

Edited by J. Danniel
Link to comment
Share on other sites

I don't know what to say.  You certainly need to practice @J. Danniel.

 

This is what your image looks like against a black background:

 

razor2.png

 

You didn't do a very good job with the eraser tool.  A lot more can be erased easily. Make sure you are erasing at 100% tolerance.

You have so many extra white pixels so far away from the razor, you can't even use AA's Assistant to smooth things out.

And....you did not save as png.  Notice how grainy your razor is.

 

Here, use my razor; I got rid of the arrows for you.

 

razorhelp_final1.png

 

And note what @Rick Brewster said:  Do not hold Shift when using the Magic Wand.

 

I'm sorry my directions weren't clear enough...I assumed you had a working knowledge of PDN.

 

Also, you could Google "razor on transparent background" and just download one.

 

Edited by lynxster4
Link to comment
Share on other sites

Thank you for your feedback.

I did say I don't use the program much, and that I'm a novice with graphics.  Against a black background, yeah, it looks horrible.  Against the background I will be using on my web site, it doesn't look quite as horrible.  At least, not with my eyes.  It's not perfect, but it's good enough for me.  I'm not striving for perfection.  I have no idea what AA Assistant is.

Razor with Background.GIF

Link to comment
Share on other sites

3 minutes ago, J. Danniel said:

it doesn't look quite as horrible.  At least, not with my eyes.

 

You really ought to use PNG. GIF only supports a limited color palette, so there's a lot of dithering in your image.

 

4 minutes ago, J. Danniel said:

I have no idea what AA Assistant is.

 

It's a plugin:

https://forums.getpaint.net/topic/16643-dpys-plugin-pack-2014-05-04/

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...