About Store Forum Documentation Contact



Post Reply 
image problems after last update
Author Message
Pherael Offline
Member

Post: #1
image problems after last update
After last update, a lot of images in game get small artifacts (white pixels on edges)
I atachment some samples from game and one sample original image.


Attached File(s) Image(s)
               
(This post was last modified: 08-28-2019 01:03 PM by Pherael.)
08-28-2019 01:01 PM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #2
RE: image problems after last update
This is due to the nature of texture filtering, alpha blending, and because it's more pronounced with gamma correct space.
You have to set transparent pixels to have the same RGB values as nearby opaque pixels. Color bleeding.
Example:
Wrong:
http://www.adriancourreges.com/img/blog/...l_rgba.jpg
Good:
http://www.adriancourreges.com/img/blog/...ol_rgb.jpg
08-29-2019 02:23 AM
Find all posts by this user Quote this message in a reply
Pherael Offline
Member

Post: #3
RE: image problems after last update
This is kinda problematic, since we have already made over 1000 images and icons for our game and Esenthel was't as much sensitive until now in this matter. That's a big problem for us, we have less than two months until relaese date. Isn't possible to have some alternative filtering for drawing images in GUI? It's looked like Esenthe right now blend with white pixels even if they have 0% alpha. Also, I can't just import RGB and Alpha separatly for images like for textures.
(This post was last modified: 08-29-2019 08:52 AM by Pherael.)
08-29-2019 08:46 AM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #4
RE: image problems after last update
Quote:Also, I can't just import RGB and Alpha separatly for images like for textures.
You don't need separate image imports for RGB and Alpha.
BMP TGA PNG WEBP PSD TIF all support RGB and Alpha, they just need to be created correctly.

There are some Image methods that could help with this:
Image& transparentToNeighbor (Bool clamp=true, Flt step =1); // replace transparent pixels with neighbors
Image& transparentForFiltering(Bool clamp=true, Flt intensity=1); // adjust transparent pixels to optimize for filtering
perhaps you could make some tool that:
reads your image files, applies the transformation from the method, and saves to another folder, then import those adjusted images to Esenthel Editor.
Please test before using and make backup of your images.

There's something like pre-multiplied alpha, however the engine operates on non-pre-multiplied alpha mode. That would require a lot of research, and testing to be added to the engine.

Also:
'transparentToNeighbor' is already integrated into the Editor.
When you right-click on Image element, and select reload
Then change path:
"....\image.png"
to
"....\image.png?fixTransparent"
by adding the
?fixTransparent
at the end.

This is an easy way to post-process images during import process.

If 'transparentForFiltering' image method would work better for you, I could add it for the importer as a file name param command too.
08-29-2019 02:42 PM
Find all posts by this user Quote this message in a reply
Pherael Offline
Member

Post: #5
RE: image problems after last update
Thanks for you help! I made few test and adding ?fixTransparent seems to be easiest way to fix white pixels.
08-29-2019 04:40 PM
Find all posts by this user Quote this message in a reply
Post Reply