Post Reply 

Artifacts after flattening two multiply layers

Sep 17, 2011, 18:07
Post: #1
Artifacts after flattening two multiply layers
Hi!

I've making a light glow texture for a game with gimp.
I've created the light with supernova effect, then i used a a black to white gradient layer with multiply, also another multiply layer is used to make the light fainter.
(there are more in the picture, these are mipmaps for game that are smaller and more shinier to get realistic glow effect).
The problem: In game it will be used for texture of an additive material, and a little artifact is noticeable if i watch carefully. These artifacts are noticable too in flattened image if i add more lightness to it.
This is what i'm talking about that halo around the light

But on mask there isn't anything like that


Attached File(s)
.xcf  feny2.xcf (Size: 23.77 KB / Downloads: 42)
Find all posts by this user
Quote this message in a reply
Sep 17, 2011, 20:24
Post: #2
RE: Artifacts after flattening two multiply layers
Are you talking about the yellow pixels? If you look at the original pixel values, it's (1,1,1) in the "regular" spots, and (1,1,0) in the yellow spots. Possibly some round-off error.

On trick to avoid this is to make you image quite larger (2x or 4x) and scale it down for usage.

Now answering your questions on
https://Gimp-Forum.net
Visit this user's website Find all posts by this user
Quote this message in a reply
Sep 17, 2011, 21:26
Post: #3
RE: Artifacts after flattening two multiply layers
no, i meant that grey band and then that even green band. The light layer should be attentuated smoothly as the radial darken layer.
the selected area http://cl.ly/1a1y0g1d3G1T2g1O2k13/Image_....11_PM.png
Find all posts by this user
Quote this message in a reply
Sep 17, 2011, 21:50
Post: #4
RE: Artifacts after flattening two multiply layers
Actually, not too surprising... you are starting with a greenish light, so the red and blue channel are clamped to 0 slightly before the green, leaving an area where the RBG values are (0,1,0) showing as green when you drag the brightness cursors all the way.. Just before that area, all computations yield values that are approximately equal to 1 (likely slightly below 1 for R and B and slightly above for G), yielding (1,1,1) when rounded off and giving the grey area.

Same problem, same cure: work on bigger images and scale them down after blurring them by the scale factor (2px gaussian blur for a x2 scale down). Or use a "Noise/Spread noise" to avoid visible banding (either on final result or on the 64 and 64 radial darken layers)

Now answering your questions on
https://Gimp-Forum.net
Visit this user's website Find all posts by this user
Quote this message in a reply
Sep 18, 2011, 20:55 (This post was last modified: Sep 18, 2011 20:56 by disc.)
Post: #5
RE: Artifacts after flattening two multiply layers
With an 1024x1024 picture with white light flattened and scaled down to 64x64 i notice nearly the same problem. But now the band is a bit

With yellow light 1024x1024 (which contains rgb more equally than green) i get exactly the same results as above both in full resolution, and in scaled down.
Find all posts by this user
Quote this message in a reply
Sep 18, 2011, 21:00 (This post was last modified: Sep 18, 2011 21:01 by disc.)
Post: #6
RE: Artifacts after flattening two multiply layers
Also every multiply layer makes layer the end result a bit darker, even if the multiply layer is full white.
Find all posts by this user
Quote this message in a reply
Sep 18, 2011, 21:17
Post: #7
RE: Artifacts after flattening two multiply layers
(Sep 18, 2011 20:55)disc Wrote:  With an 1024x1024 picture with white light flattened and scaled down to 64x64 i notice nearly the same problem. But now the band is a bit

With yellow light 1024x1024 (which contains rgb more equally than green) i get exactly the same results as above both in full resolution, and in scaled down.
Well, whatever way you look at it, you take a large range of values, and your operations reduce that to a much smaller range of values, so you get the same banding effect that you get when you severely reduce the available colors (Colors/Posterize). And the cure for this is "spread noise" that moves pixels around slightly, so that adjacent pixels are much less likely to have the same value, so in the final result they are also more likely to have different values and this prevents visible banding. In the sample below, the upper stripe is a full gradient, the middle is the above reduced to 10 colors, and the bottom is the upper reduced to 10 colors after applying spread noise (20px).
[attachment=671]

Now answering your questions on
https://Gimp-Forum.net
Visit this user's website Find all posts by this user
Quote this message in a reply
Sep 18, 2011, 23:31
Post: #8
RE: Artifacts after flattening two multiply layers
spread noise does not helps nor before flattening, or after flattening. But i've tried it with photoshop and it resulted the same... but enabling rgb 16bit/channel processing, it was perfect. Of course the end result was saved in rgb 8bit, but it looked good too. So the problem is the processing is "lossier" in gimp since it havent got 16 bit/channel mode.
Find all posts by this user
Quote this message in a reply
Post Reply 


Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Why Can't You Select All Layers nihiloth79 1 226 May 30, 2017 00:34
Last Post: ofnuts
  Exporting Multiple Layers Into Images (PNG, JPG, etc) SavingMultipleImages 22 10,796 Oct 6, 2014 10:59
Last Post: rich2005
  Issue with Layers and Lighten only mode pgodfrin 14 829 Jul 5, 2014 22:09
Last Post: pgodfrin
  I found a bug with moving the layers and docable dialogs. How do I fix it? CopperZirconium 2 356 Jun 21, 2014 17:21
Last Post: CopperZirconium
  Start without layers when creating a new image? puggsoy 5 408 Jun 16, 2014 12:01
Last Post: puggsoy

Forum Jump:


GIMP ForumPortalArchiveContactTermsRSS