[Closed] Artifacts on white areas of image button
So please copy the image file I have attached below, and put it in your c: directory. Then run this maxscript code:
theBmp = "c:\\ArchInt_Lightbulb_Icon.jpg"
rollout image_button_test "Image Button"
(
button theButton "test" width:50 height:50 images:#(theBmp,undefined, 1,1,1,1,1 )
)
createDialog image_button_test 100 100
Check that the results look like my second attachment (result,jpg).
Anybody know why do all the white parts of the image appear greyish and artifacty in the rollout?
Thanks.
- Neil
it’s default transparent color. and it’s not white as i remember. i couldn’t find a way to resolve this issue.
as a workaround could be using imgTag instead of image button
Not sure if imgTag will work for my purposes, but I’ll give it a try, thanks. If anyone else has more info on why buttons function like this, I’m all ears
- Neil
Funny – the artefacts are black in my case, so i guess this is some color in the UI config …
Of course … the Max UI background is coming through in the artefacts
The mask is apparently defined by pure white pixels ( 255/255/255 ) – i leveled the color to contain 250/250/250 max and now the artefacts dissapeared
I also have some issues with pure black & white colors. But it seems to depend on the max’s UI theme (dark/light). I made some tests on max2012 in classic gray theme and max2014 in dark theme :
max classic gray interface :
– imgTag : pure black = visible
– imgTag : pure white = visible
– button img : pure white = transparent (Neil’s img)
– button img : pure black = visible
max dark interface :
– imgTag : pure black = transparent
– imgTag : pure white = visible
– button img : pure white = transparent (Neil’s img)
– button img : pure black = visible
On imgTag, pure black seems to be a transparent reference under dark theme, not under light theme.
I found that the black in Neil’s img is not pure black so I tried to convert some black area in pure black, some of the white transparent pixels were removed, not all of them.
When I have icons with buggy colors I use GIF format in indexed colors to change my pixels. It does the trick.
Also I was able to fully remove the buggy white pixels on Neil’s img by opening the img as follow :
theBmp = opendBitmap "c:\\ArchInt_Lightbulb_Icon.jpg"