Can I stop Unity remembering data that has been erased from PNGs?

I have been working on a texture for an avatar to put in VRChat using Blender and Krita.The texture looks completely fine when in Blender but when I import the PNGs to Unity, issues occur. The main body texture appears on the avatar just fine, but the PNG I am using for emission imports with dots and splotches that are NOT on the original PNG. dwdIt appears that Unity is remembering some kind of data that is no longer present in the PNG.

What it SHOULD look like shown in Blender

The exported PNG showing no extra spots/splotches

I re-exported the PNG from the Krita file a few times, to no avail. I made sure the file was deleted completely from Unity and also from where I had it saved in the folder. I even restarted my computer to see if that fixed it but it did not. To test my theory on Unity remembering data, I added a blue spot in the texture, exported it as a PNG. Then I erased that blue spot in Krita and re-exported it as a second PNG. I took this second PNG and exported it into Unity. The preview of the texture in the inspector showed the blue spot I had added and the spots and splotches were also still present that had been erased a while ago.

Comparison of PNG and it’s imported version in Unity

What it looks like on the avatar in Unity 1

What it looks like on the avatar in Unity 2

New contributor

Cepheron Kalle is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

This is usually not an issue in Unity but the program you use to edit the png file. Depending on what you mean by “erase”, most editing programs just set the alpha channel to 0 but leave the color channels intact. Different programs behave differently and have different tools to deal with that.

We don’t know how you apply those textures inside Unity. If it’s some kind of decal, multiply or additive shader, it may ignore the alpha channel. It’s hard to tell just from seeing images.

Inside Unity the texture preview has those buttons on the top:

With those you can view individual channels so you can see what the actual color channels (R, G, B) contain. Your image editing software may have an option to fill pixels which have an alpha value of 0 with a certain color (you probably want black).

Clearing out the alpha==0 regions is generally a good iead as keeping those will make the image larger than they need to be.

ps: I’m not sure if Unity would actually clear out the fully transparent pixels when you tick the “Alpha is Transparency” checkbox during import. However this probably wouldn’t really work for you as this checkbox deliberately adds color information in the fully transparent pixels around the edges to avoid color bleeding when the alpha channel is used for transparency / alpha blending.

Note that the alpha channel is just another data channel. It doesn’t have to represent transparency. This all comes down to the shader in use.

1

I don’t know anything at all about Unity, blenders or Kritas but am just trying to help by pointing out that images with alpha/transparency (such as PNG) can have all sorts of junk concealed in the alpha channel. I’ll show you a way of removing it too.

So, here is an image of random dots with a transparent hole in the middle:

If, I use ImageMagick to separate the image into Red, Green, Blue and Alpha channels and lay them out across the page with Red on the left, then Green, then Blue and Alpha on the right:

magick image.png -separate +smush 10 channels.png

You can hopefully see that all the random stuff is still there in the transparent hole in the Red, Green and Blue channels, but it is just concealed by the black rectangle in the alpha channel.

Maybe that is what is happening – you can try the magick command above and see.


Now let’s remove it. Thanks to Fred @fmw42 for the simplified removal method in the comments:

magick image.png -background black -alpha background result.png

If we look at the result image, we see that the random colours are gone and replaced with black in the transparent hole:

magick result.png -separate +smush 10 channels.png

1

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật