Antialiasing to Transparency in DAZ Studio?
Boingo the Clown
Posts: 97
I have been using DAZ Studio to render out some sprites for a game project I have been working on.
Until now I thought DS antialiased the figure(s) in a render with no background to transparency because renders saved to PNGs had transparent backgrounds. At the coarse resolution of the game I have discovered this is not true. The figures are in fact antialiased to the background colour used by the editor. As a result, all of my sprites have thin but noticeable outlines in that colour around their edges.
Is there a setting that will allow DS to antialias my sprites to transparency, thereby eliminating these outlines and making them look better in my game?
Comments
NO is the simple answer.
You will need either a MASK maker We did have Surface Mask Creator for DS3 and up to a point is still works in DS4.6 http://www.daz3d.com/forums/discussion/8743/. Adam is working on a new one but no tme frame to when that will be available. Or if using Photoshop use Defringe to get rid of the outline or make the background a similar colour to what you are overlaying the Sprites on to.
Yes, simply set the background to black.
Note, that when saving images in PNG format, you will get a premultiplied alpha channel. If you do not want that, you can save as TIFF, DS will reverse the premultiplication then, but it only works for a Gamma of 1 (because of a bug); probably you would use Gamma=1 anyway in your application (if you do not understand this last sentence, just save as TIFF).
You will still get a Black edge when setting the background to black and saving as PNG or TIFF unless things have changed recently and I haven't noticed it which is possible with not using DS4.6 much.. ;)
No, i will not. Alhough i can understand what probably makes you think i would. When saving as PNG, i will get a premultiplied alpha channel. In order to use it i will either need to unpremultiply it (or predivide or whatever it is called), or use an appropriate blending mode to put it onto a background. What will NOT work, is to simply load it into GIMP (or photoshop, same thing) as a layer, leave the default layer mode at "Normal" and hope for the best. That will indeed leave a dark border around the object. But this is probably what 90% of the Photoshop users do, understandably, because Photoshop is a very complicated program and nobody wants to spend hours reading to find out how it works; and that is probably the main reason it can be seen in so many renders on the internet. In this case saving as TIFF could help; TIFF and PNG are different in this regard (at least in DS4.6), not by definition, just for a matter of fact. Works only within limits, though, because of some issues with the exposure settings and some small errors because of the limited bit-depth. But there is no real reason why Boingo the Clown should run into the same same problems, after all he is making a game, not using Photoshop, when in fact the dark borders stem from Photoshop, not from the renderer. Of course, there should be something in the documentation of the game engine if it accepts straight alpha (-> TIFF) or premultiplied alpha (->PNG) images as input.
Granted if you use say the Screen blend mode in Photoshop and use black as the background colour for the render you will lose the edge. This ok if you are not intending to use it as an overlay on top of another image but yes if it just a sprite then it will work.
But I was just taking about how the render comes out, as standard, out of Daz Studio and not using any other program.
I would be very interested in seeing/reading the info on that it is not the rneder that has the edge but when taken in to Photoshop. This is news to me and I would like to see if for myself. Can you provide me the link please.
I have a dumb question.
How do I set the background to black?
When I go to Edit > Backdrop it does not give me the option to change the colour. It asks for a bitmap instead.
Am I missing something?
hope that helps
The Black Background is the best way, as the Alpha channel will then see the Anti A as mostly Alpha also. Not Perfect but workable.
No, i will not. Alhough i can understand what probably makes you think i would. When saving as PNG, i will get a premultiplied alpha channel. In order to use it i will either need to unpremultiply it (or predivide or whatever it is called), or use an appropriate blending mode to put it onto a background. What will NOT work, is to simply load it into GIMP (or photoshop, same thing) as a layer, leave the default layer mode at "Normal" and hope for the best. That will indeed leave a dark border around the object. But this is probably what 90% of the Photoshop users do, understandably, because Photoshop is a very complicated program and nobody wants to spend hours reading to find out how it works; and that is probably the main reason it can be seen in so many renders on the internet. In this case saving as TIFF could help; TIFF and PNG are different in this regard (at least in DS4.6), not by definition, just for a matter of fact. Works only within limits, though, because of some issues with the exposure settings and some small errors because of the limited bit-depth. But there is no real reason why Boingo the Clown should run into the same same problems, after all he is making a game, not using Photoshop, when in fact the dark borders stem from Photoshop, not from the renderer. Of course, there should be something in the documentation of the game engine if it accepts straight alpha (-> TIFF) or premultiplied alpha (->PNG) images as input.
Thanks for the info...
I vaguely remember but I think it was psp not photoshop that there used to be an option to defringe?? Sorry early in the morning here and I can't remember exactly the option but think it was defringe and you had the choice of black or white.
In CS2 the Defringe is here
Thanks Szark. :-)
I was really getting tired of that powder blue background DS 4 starts off with. I was able to change the background colour in DS 1, 2, and 3, but couldn't figure it out in DS 4.
I will trymmillighosts suggestion and see if it works.
That always gets me confused...certain aspect of DS4/4.5+ haven't changed since DS2. Anyways you found it now and that's what matters.
Good luck
millighost's technique seems to be working. There still appears to be a slight outline, but it is certainly not as severe.
Of course this means I am going to have to go back and redo a whole bunch of sprites I did earlier, but at least it is going to be for a good reason.
Here is an illustration showing the difference between the TIFF and PNG output of DS. I rendered a cube on a plane against a black background and saved the render to TIFF as well as to PNG. Separating the alpha and color channels in GIMP it can be seen that the alpha channels of the two formats are the same, but the color channels are not. PNG has those antialiased-looking smooth edges, whereas TIFF contains basically only the color in the border pixels (i.e. not the background). So there is no real "standard how the render comes out of DAZ Studio"; there are actually two standards. Of course the two different color channels give different results when put on a background in GIMP with a layer mode "Normal". The PNG results in the border pixels being too dark. But the TIFF output works.
The reason for this is that the "Normal" layer mode calculates foreground_color * alpha + background_color * (1 - alpha), but it can only calculate this if there is a foreground_color. In the PNG image the pixels contain a mixture between foreground and background, so this does not work. In fact, the color channel in the PNG image contains alpha * foreground + (1 - alpha) * background, but because the background is black (value zero), it effectively contains only alpha * foreground (hence the term premultiplied).
So, since the PNG color channels already contain alpha * foreground, but what is needed is alpha*foreground + (1-alpha)*background, all that is needed is to add the (1-alpha)*background part. In GIMP i create an additional layer containing the inverted alpha channel (the (1-alpha)-part), multiply with the background (creating (1-alpha)*background) and add it to the render, which gives the same result as in the TIFF-case, no defringe or something like that needed.
Of course, this is slightly more complicated than just a single "Normal"-layer because it requires an additional layer. But on the other hand the premultiplied alpha is the de-facto-standard for renderers (that 3delight outputs an unpremultiplied color channel for TIFF images is the exception rather than the norm), and other applications than GIMP (or photoshop) which are more geared towards compositing renders support it out of the box anyway. In OpenGL, for instance, it simply means to use a different parameter for glBlendFunc().
I'm convinced.
Yeah thanks for that. Things have definately changed then as I tested this a few years back and Tiff and PNG aplha were the exact same. Whereas as you pointed out the TIFF comes with a seperate mask/alpha layer.