Home Technical Talk

Circle is a square. (.png)

polycounter lvl 11
Offline / Send Message
GeeDave polycounter lvl 11
- Be in photoshop
- Create single layered texture
- Save it out as .png
- Load up Max and put it on an object:

CircleSquare.gif

I should note, that I can fix this by just creating a layer underneath (in photoshop) and filling it with a colour. I'm not interested in the fix though, I'd just like to know why this is happening.

As you can maybe tell, it seems Max stretches the red circle to its boundaries, creating a square... though the middle circle remains undistorted, while the two smaller black circles get awkwardly skewed.

I'm pretty sure you can re-create this yourselves, but if anyone would like my source files I'll upload them.

Replies

  • Farfarer
    Options
    Offline / Send Message
    PNG has options to save transparency either as transparency or an alpha channel.

    Photoshop's default plugin uses transparency. Check out SuperPNG, it gives options to save it as alpha channel or as transparency.

    http://www.fnordware.com/superpng/
  • GeeDave
    Options
    Offline / Send Message
    GeeDave polycounter lvl 11
    Cheers for the response, I don't quite follow you though.

    I'm not sure this is related to transparency, I downloaded SuperPNG and I get the same results regardless of what I choose. No alpha, transparency or forcing it to use the Alpha 1 channel.. same results as above.
  • joeriv
    Options
    Offline / Send Message
    joeriv polycounter lvl 7
    Just to be sure, did you check this option in your image settings?

    alphab.png
  • monster
    Options
    Offline / Send Message
    monster polycounter
    PNG files don't display alpha in the viewport automatically. You need to apply it to the diffuse and opacity channel. In the opacity channel change the alpha source setting as Joeriv indicated. Also, make sure transparency is enabled in the viewport settings.

    To explain what you are seeing...

    All pixels in a PNG have an RGB value regardless of their transparency value (A). In Max you are seeing RGB when you are expecting RGBA.
  • GeeDave
    Options
    Offline / Send Message
    GeeDave polycounter lvl 11
    I'm not trying to get the alpha working. Just so we're on the same page. I just want to know why the red circle expands into a square at its boundaries. As I said before, I can fix this easily enough by adding a filled layer at the bottom in photoshop, but I'm not interested in the fix. For the purposes of this, I'm not producing an alpha'd image, I just happen to be using a transparent .png for no reason other than to understand what it's doing.

    Here's another example:

    2012-10-11_1226.png

    And when I add my own blank white layer:

    2012-10-11_1231.png

    The bit I'm not getting, is why it doesn't just auto-fill the blank areas with white, like it does for other parts of the image? I mean, the expanding to the boundaries is interesting, and it helps in some cases too (diffuse edge padding for no messy alpha, if I was interested in using alpha)
    Transparency is not the absence of pixels; it's an additional channel, hence the "circles to boxes thing"

    I understand the first part of that, but I don't know why it explains the "circles to boxes" thing. I know how to get this image working with alpha, I'm just curious as to why it chooses to expand my colours to their boundaries, why wouldn't it just display as white?
    To explain what you are seeing...

    All pixels in a PNG have an RGB value regardless of their transparency value (A). In Max you are seeing RGB when you are expecting RGBA.

    I was actually just expecting RGB, I was thinking it would say "oh, he hasn't coloured in those parts, let's just fill it with white"... rather than ... well, rather than what I see.

    I'm sure you guys are probably explaining this well enough... but I'm just not getting its behaviour.
  • Farfarer
    Options
    Offline / Send Message
    It expands to a square because it's easier to encode square blocks of colour.

    The image considers that part to be transparent anyway, so it block fills it with the nearest colour to pad it. It could just fill it with white, but then you'd get white peeking in around the edges of the transparency.

    Each pixel has to have an RGB and an A value. It's not just transparent, it has a colour but as it's also got an alpha of 0.0, it doesn't really matter what the colour is. So it just fills it in for however it sees fit for best results/best compression.

    In this case, Max is ignoring the alpha channel because you've told it to. So it's showing the full blocks of colour (rather than the colour being masked by the alpha channel).
  • GeeDave
    Options
    Offline / Send Message
    GeeDave polycounter lvl 11
    here's no such concept as "zero pixels". Photoshop needs to fill the transparent space with something.

    Aye, and I was just expecting it to fill with white, that was all. Rather than expanding to blocks of the colour/s that I was using. I figured someone around here would know why it was doing this. Since it needed to... as you've said, fill the transparent space with something, I was just curious as to why it wouldn't choose white.

    There is no practical application here, I'm not even trying to do anything... I was just curious as I'd never seen it before. This is likely the first time I've ever dropped a transparent .png into Max.

    @Farfarer, cheers too!
Sign In or Register to comment.