Previous topicNext topic

Noise/dots when laying transparent .png (+ solution)

Questions, comments, feedback, etc.
Post Reply
TKS
Posts: 139
Joined: Mon May 17, 2021 10:40 am

Noise/dots when laying transparent .png (+ solution)

Post by TKS »

The picture below are piano keys, each key is a .png with transparent background of one single key of a piano.

The 88 keys of the piano are added from the rightmost one to the left by directly connecting to the scene's output in this order.
The keys are white(!), they are neither grey nor do they have any black dots

The more key-pictures I add, the more noise/dots are visible, increasing from the left side (no noise) to the right side. Additionally they become more and more grey.
Shouldn't transparent .png be transparent, no matter how many .png are layered on top of each other?

http://178.254.23.111/~pub/temp/Piano-Problem.jpg

Edit:
TLDR; cause and solutions are here: https://magicmusicvisuals.com/forums/vi ... 692#p11692
Magic
Site Admin
Posts: 3440
Joined: Wed Apr 09, 2014 9:28 pm

Re: Noise/dots when laying transparent .png

Post by Magic »

Very strange, I've never seen anything like that before. Any way you could zip and post a Magic project so I can download and test it?
Sadler
Posts: 1139
Joined: Sat Aug 02, 2014 7:10 pm
Location: London, UK

Re: Noise/dots when laying transparent .png

Post by Sadler »

I would guess that since the dots increase the more keys you have, that your alpha isn't completely clean.

See if this one does the same:
white-key.png
white-key.png (4.38 KiB) Viewed 8534 times
TKS
Posts: 139
Joined: Mon May 17, 2021 10:40 am

Re: Noise/dots when laying transparent .png

Post by TKS »

Sadler wrote:
The attachment white-key.png is no longer available
Thanks for your time to help, I really appreciate this :-)

My keys can't have transparent sides because when the neighboring key goes down this would be visible,

This is how it looks during play:

Update: I've uploaded the video anyway, so you can watch the animation here:
https://www.youtube.com/watch?v=Fa1uTDLe9mg
Attachments
Piano-Problem2.jpg
Piano-Problem2.jpg (259.66 KiB) Viewed 8532 times
Valis
Posts: 21
Joined: Thu Feb 11, 2021 6:37 am

Re: Noise/dots when laying transparent .png

Post by Valis »

Are you using 32bit or 8 bit png?
Terry Payman
Posts: 710
Joined: Sun Sep 14, 2014 8:15 am
Location: UK
Contact:

Re: Noise/dots when laying transparent .png

Post by Terry Payman »

Sadler wrote:I would guess that since the dots increase the more keys you have, that your alpha isn't completely clean...
My first guess too.

Some further thoughts on this:

If the black keys use the same layering method, the problem could be common to (or entirely caused by) the black key png(s).

Try disabling the black png(s) and see if that affects the white key problems. The black keys have the same problem with dark dots, although it's far less conspicuous. Try disabling the white png(s) to see if that affects the black keys.

It would be helpful if you could attach a png for a black and a white key so we can examine them. If you want to examine these yourself then look purely at the alpha layer of each png file, perhaps using the techniques discussed here:
https://magicmusicvisuals.com/forums/vi ... pha#p11480.
As you're looking for a very low level problem I think it will be necessary to boost the brightness, for which I suggest you use the Exposure Adjust module. An InputEV setting of 10 will show anything that's not 0 as full brightness, slightly reducing the value will show more detail. From your symptoms I would expect to see a grey background with brighter dots.

If you're (understandably) reluctant to share any details of your ingenious (and beautiful) keyboard with the whole forum I suggest you take up Eric's offer to test your project if the above doesn't identify the problem.

ps I really like your video and your boogie, but I don't feel that I'm seeing as many (right hand) notes as I'm hearing. Have you tried rendering at 60fps instead of 30fps?
TKS
Posts: 139
Joined: Mon May 17, 2021 10:40 am

Re: Noise/dots when laying transparent .png

Post by TKS »

Terry Payman wrote:
Sadler wrote:I would guess that since the dots increase the more keys you have, that your alpha isn't completely clean...
My first guess too.
I've loaded the keys into Gimp (graphic software) and verified that the Alpha is completely clean.
Try disabling the black png(s) and see if that affects the white key problems. The black keys have the same problem with dark dots
Yep, black keys have the same problem, but it's note as visible.
Disabling the black keys makes absolutely no difference. It's really just the number of keys, e.g. with each white key that I disable on the left side the following keys (to the right) get better. When I show only the rightmost white key it's perfect, so it's really not an exposure level but a layering problem.
It would be helpful if you could attach a png for a black and a white key so we can examine them.
See key 86 and key 87 attached below. The images are 2560 pixels wide, not sure if they are displayed on a forum message. But you should be able to download them.
If you're (understandably) reluctant to share any details of your ingenious (and beautiful) keyboard with the whole forum I suggest you take up Eric's offer to test your project if the above doesn't identify the problem.
@Eric , can you provide me your email address? I will create a stripped-down version of the problem and send you a link to download it.
ps I really like your video and your boogie, but I don't feel that I'm seeing as many (right hand) notes as I'm hearing. Have you tried rendering at 60fps instead of 30fps?
30 fps is plenty, I guess I have to increase the MIDI resolution when I render the song to MIDI. When I play my animation directly with my MIDI-piano (instead of the MIDI-file) I can do crazy slides and each single key is visible.

Again, thanks to you all for your help!
Attachments
White key
White key
87-Up.png (272.26 KiB) Viewed 8507 times
Black key
Black key
86-Up.png (265.37 KiB) Viewed 8507 times
Terry Payman
Posts: 710
Joined: Sun Sep 14, 2014 8:15 am
Location: UK
Contact:

Re: Noise/dots when laying transparent .png

Post by Terry Payman »

Both the black and white key png's have many dots in the alpha, especially on the right-hand side. Sorry about the scale of my screenshot. Scroll down, then across, or "open image in new tab".
Alpha noise on both files.png
Alpha noise on both files.png (496.63 KiB) Viewed 8504 times
TKS
Posts: 139
Joined: Mon May 17, 2021 10:40 am

Re: Noise/dots when laying transparent .png

Post by TKS »

Terry Payman wrote:Both the black and white key png's have many dots in the alpha, especially on the right-hand side.
Hmh, interesting way to make this visible, in the graphic program the alpha-channel is completely clean.

At least I can now check myself if it's possible to change the problem at the source (the keys are rendered with DAZ Studio) or if I have to create some script-fu to make it clean.
Thanks again!
TKS
Posts: 139
Joined: Mon May 17, 2021 10:40 am

Re: Noise/dots when laying transparent .png

Post by TKS »

So, here are the results of my investigations, and I'll add a link to this post as a TLDR; into the first posting.

Problem:
  • when you layer lots of .png images with a transparent alpha channel black dots/noise gets visible, especially in the brighter parts of your image
Cause:
  • the alpha channel of your images is not completely clean, there are (non-transparent) dots which you don't see in real life, but add up when you stack enough layers on top of each other.
    In my case those dots where the result of rendering those images with the 3D program DAZ-Studio.
Solutions/Workarounds:
  • New images:
    • the problem is DAZ-Studios "NVIDIA Iray" renderer which renders reflections of light-dots even when there's no floor/ground to reflect them. Even DAZ' setting "Denoise Alpha" does NOT significantly reduce them.
      You can workaround this by:
      • add a chroma-key non-reflective green floor/ground (a simple plane with the color RGB 0, 177, 64 does the job) and use Magics chromakey module to make the background transparent. In most cases the result is the same as using a transparent alpha-channel
      • use a different render engine, DAZ Studios included 3DLight renderer works without any noise in the alpha channel
      Keep in mind that both solutions slow down the render time!
  • Existing images:
    • Post process the images: for single or few images you can do this in the graphics program of your choice
    • For bulk-processing you can use Image-Magick, but I was never able to really remove ALL noise. Maybe some Image-Magick guru here knows some additional tricks. But for bulk-processing of complete folders of images it's good to know this tool anyway...
    • Add a "RGBA Swap" module to each of your images in your Magic project and set the "Alpha" channel to "Average". This will not completely remove the visible noise, but averaging removes most of it to an acceptable degree.
      If you (like me) have a generic processing Scene for all of your images you can do this here at one central place. If not: sorry, you've just learnt it the hard way ;)
If additional solutions and/or workarounds are found I'll add them to this list, so feel free to post them.
Post Reply