When I make a render in Blender with transparent parts, like a leaf, I notice that the edges of the image where the transparent part start have a bit of a “background” color added. Is this how png and similar files work? Can there be no background color? I use the GIMP image editor and dont see a way to even know the color of the background.
I sure hope there is a way to get rid of that color.
thx
You need to check the box to premultiply alpha in the material>texture settings.
Then the white artifacts be gone.
edit:
oh and if you use raytracing or overlapping stuff, be sure to have z-transparency on for that material and its alpha all the way down to 0 and let the texture control the alpha.
can you explain or give a tut on how to make a transparent image in GIMP
Thanks
Simply create a new file with transparency. Done.
Existing file, rightclick any layer and choose add alpha channel.
Either edit the alpha channel directly then in the channel dialog in the layer window, or work with the eraser and different brushmodes and opacitys for the eraser tool in the image itself.
Just be sure to save your file in a format supporting transparency, like png or tga.
Thx
But actually I use the rendered png images in another program (say GIMP), so can I just tell Blender to not add background color to the png file?
Let this topic not be forgotten.
Select RGBA as the output type in the output box. It will then add alpha information to the file, which .png can use. The background will then be saved as transparent, while the rendered object will remain. Also make sure that “Straight Alpha” instead of “Sky” is activated in the shading tab in the render settings. Your BG, no matter the color will render black then, but this just means that it is not taking BG color into consideration and will save out as transparent in the .png file.
The cube rendered out in this mode and brought into Paint Shop Pro looks like this…
Had to make a screen capture since the BG would look white in the forum, thus not making it look like it was really transparent.
Hope this helps.
Of course I do select RGBA. But Im using blender 2.49, so I cant find the “Straight Alpha” option.
But from what you said it looks like the background color will simply be black now, and i asked if I could disable the background color completely, not change it.
You’ll need to save your image file in a format which handle alpha, e.g. png, tga, etc…
I think i have mentioned in my forum topic TITLE and text that I use png. Which leads me to believe you didnt really read it all carefully.
As the 2.49 manual states, goto ‘Render’ -> ‘Render Layers’ and deselect ‘Sky’, that’s the bit ajm was referring to about ‘straight alpha’, or the old way.
Reason why I stated about png and tga is because not just you will gain help from this thread, as you said “Let this topic not be forgotten.”, even though this topic has been covered many times in this forum alone…
Ill try it out
Reason why I stated about png and tga is because not just you will gain help from this thread, as you said “Let this topic not be forgotten.”, even though this topic has been covered many times in this forum alone…
Please lets not start an argument. Maybe I was a bit harsh and I apologise if it sounded like that. But the reason you just gave sounds like you dont want to accept that you simply didnt read the whole topic. Thats not my question, its not just a part of your answer , and I was simply bumping my thread to get answers.
Anyway, this is too trivial to waste our time.
I’m only trying to help out, poorly finger, abscess in a tooth and very very bored… mmm lot’s of painkillers too…
anyway,
I dont see much difference. Is there a fast way to find out if a transparent png has a “background color”?
Load it into Blenders sequencer and then underlay with another image and apply an alpha over strip…
Apply a what?
Another probably easier way…
Change a viewport to ‘UV / Image Editor’, open your image and click the ‘Draws image with alpha’ (or ‘Draw image with RGB colors and alpha transparency’ in 2.5x) button, if the background looks like that of ajm’s try.png, then that area is transparent.
Or, just open in GIMP and look for same background…
The black color you see will be transparent when saved as a .png like I said in the previous post. There will be no color exported, but the rendering engine doesn’t render the checkerboard pattern like you are used to seeing. I would follow the advise above, save out the image as a .png and load it into GIMP, Photoshop, or Paint Shop Pro and see what I am talking about. The screen shots that I had shown you above are the direct result of using the method that I had outlined. I did not remove any background color at all from the rendering with any external program. The render view showed the BG as black, but the exported file showed nothing but transparency.
Please try again and ignore the fact that what you are seeing is a black background, for this is how it is supposed to look if you did it right. If your default blue BG from Blender is gone and it is now black, it means that the BG was not calculated and will be treated as transparent when you save the image to a format that supports alpha information. You will see this if you save the image file and import it into an image manipulation program or just have it sitting on your desktop.
This render…
Yields this result…
No outside editing required, straight from the render.
Now I think you didnt understand too.
I DO see transparency. Im not saying that there is no transparency. There is. BUT there is also “background color”, which is not visible.
It is more NOTICEABLE when you have a feathered edges in your transparent image. That color is blended with the semitransparent pixels.
This is very noticeable when loading those images in a realtime program or even in GIMP. Maybe blender uses a slower and higher quality alpha mode by default which doesnt use background color, I dont know. But one thing I can tell for sure is that such a background color exists in formats like png, when you have alpha channel:
http://www.yofrankie.org/tutorial-low-poly-tree-part-4/
Watch the parts 14:29 - 14:55 and 15:44 -15:54
In this tutorial the background color is set to match the leafes and branches, although a transparent png is created.
Example:
- the background color is black:
- the background color is green:
Do you see what I mean?
Not sure if this is the solution, so don’t shout…
But what about turning down the ‘Amb’ slider in the ‘Shader’ tab on your material?
With particles, I always set (2.4x method), in the ‘Scene’ viewport, on the ‘Output’ tab, select ‘Save buffers’ and ‘Full Sample’.