Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Transparency fill borders
#1
In game engines and 3d software, to counter transparency issues, they use a technique where they fill the transparent parts with the borders or edges of non-transparent parts, I don't know what this technique is called.
Here's an example with fortnite, but all new 2d and 3d games do this.
   
   
-What is this technique called in for example photoshop?
-How can you do this with gimp, preferably automated with a script?
Thanks in advance!
Reply
#2
You could try the resynthesizer plugin + heal transparency, grows pixels outwards to fill the transparency. It is a radial fill, not the same as your example. Windows plugin here: https://www.gimp-forum.net/Thread-Resynt...or-Windows

A slightly better result but a bit on the slow side & still a radial type of fill.  gimp_gmic_qt plugin from http://www.gmic.eu

   

Fill the transparency with 100% red (has to be pure red #ff0000) Remove the alpha channel.  https://i.imgur.com/QK1L3xN.jpg
Apply gmic Inpaint (Morphological) Small mask dilation, Input: active layer, Output: new layer.  https://i.imgur.com/spvg4Ga.jpg
Put the original image on top to reinstate the edges.  https://i.imgur.com/zS1f2Iv.jpg
Reply
#3
I don't know if this technique has a particular name, but technically, it is a voronoi diagram : color of a transparent pixel is replaced by color of the (spatially) nearest opaque pixel.
GEGL has a work-in-progress operation to do this.

   

Unfortunately, it is currently only available for developpers (not in the stable release).
Reply
#4
(05-09-2020, 03:14 PM)tmanni Wrote: I don't know if this technique has a particular name, but technically, it is a voronoi diagram : color of a transparent pixel is replaced by color of the (spatially) nearest opaque pixel.
GEGL has a work-in-progress operation to do this.



Unfortunately, it is currently only available for developpers (not in the stable release).

This looks closest to what images with transparency look like when transparency is removed, which I did in the first post with the second image.
https://docs.unity3d.com/462/Documentati...amaps.html
https://assetstore.unity.com/packages/vf...ding-57720
I did some further googling and the  technique is so called "edge padding" and this is done to avoid seams or "bleeding" in games if the transparent area's near the border of the opaque areas are too different of the border opaque pixels.
On the first link there is a script named "AlphaUtility.atn" for photoshop that has an action "dilate" but I don't have photoshop, maybe someone can make a gimp version.
G'MIC's solidify is also an option but is very slow, to "solidify" the image below took 25 seconds.
   
Reply
#5
Another way to obtain something similar : Filters > Distorts > Value Propagate
Change the Mode to "More opaque".
Ctrl+F to repeat the filter
Reply
#6
(05-09-2020, 04:26 PM)tmanni Wrote: Another way to obtain something similar : Filters > Distorts > Value Propagate
Change the Mode to "More opaque".
Ctrl+F to repeat the filter

You'll have to press Ctrl+F like a 100 times to get results Big Grin , but it's fast.
How do I get developer version of gimp to test GEGL voronoi, is it fast?
I've never build from source code and probably never will, too much hassle and I'm not a really a programmer...
Reply
#7
(05-09-2020, 04:37 PM)joeyeroq Wrote: You'll have to press Ctrl+F like a 100 times to get results Big Grin , but it's fast.
How do I get developer version of gimp to test GEGL voronoi, is it fast?
I've never build from source code and probably never will, too much hassle and I'm not a really a programmer...

It's the GEGL developper version, not gimp.
It's instantaneous with the image you post.

Some info here to compile gimp and its dependencies
https://wiki.gimp.org/wiki/Hacking:Building
Reply


Forum Jump: