Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Merging layers changes the pixel colors
#1
I have an application that requires combining multiple layers all with single color elements on transparency. This worked fine the first time I tried it but now at the borders the pixel colors are being changed. For example where a black edge met a red/blue surface some pixels have now changed from 7f007f to 7c007c. This is a total disaster for my application. Why is this happening and how do I prevent it? I have checked the process at every step. I have selected and deleted all the transparent areas and confirmed that it included the pixel in question. I have checked the pixel before the merge and after the merge and it is altered after the merge. Any suggestions are appreciated. I hate to dig out my ancient copy of PaintShopPro to do such a trivial task. This is not rocket science and should be a simple process.

I am checking the pixel color with the color picker tool before and after the merge. It only affects a few pixels at the edges of the overlay but even one pixel being changed invalidates the image. I get the same result exporting the image to a single layer format (.bmp)
Reply
#2
Can you attach a small XCF that exhibits the problem?
Reply
#3
Instead of merging the layers, did you try a right click on any layer in the stack (or the top one) and New from Visible ? have the color changed on the new layer Visible?
Reply
#4
The right clicking on new layer from visible yielded the same result. I have managed to crop it down to a small piece and still found the offending pixel. The top layer is the New form Visible. The problem layer is where the pixel is correct. The layers above should be completely transparent. If they are not I would dearly love to know how to make them so. The pixel is located at 178, 95 where the merged color is 7c007c on the top layer and 7f007f on the problem layer which is the correct color.


Attached Files
.xcf   ProblemExample.xcf (Size: 105.17 KB / Downloads: 176)
Reply
#5
Strange. As far as I can see from the clip, all those "transparent" layers are not truely transparent, there are remnants of RGB there.
Use the color picker (sample ave & merged off) in the transparency as a check.

     

For that example image, remaking with RGB = 0 and new-from visible gives correct value.
Reply
#6
I assumed that was the case but I selected all the areas I wanted to keep, inverted the selection and then deleted the selection. The problem looks to have nothing to do with RGB but with transparency. The problem pixel says it is black, 000000. But it appears white if you have only layers 1 and 8 on. Even if you paint it black with the paint brush it still looks white because some time in it's past life that pixel was transparent. The fix should be simple, select the black area which will pick up the transparent pixels also, then tell Gimp to remove the transparency. I don't see a way of doing that. Is it possible to do? I don't feel like putting in another 20 hours redrawing my images I have started.
Reply
#7
Quote:.....The pixel is located at 178, 95 where the merged color is 7c007c on the top layer and 7f007f on the problem layer which is the correct color.....

A bit more methodical this time, set a sample point at 178,95  which gives the 7c007c value
Put the top layer into dissolve mode and you might get the required value 7f007f without degrading the bits we can not see Wink

   

The real problem is why the RGB values in transparency. You mentioned PSP Did anything originate there, or from some other graphics application?

EDIT
Quote: The fix should be simple, select the black area which will pick up the transparent pixels also, then tell Gimp to remove the transparency. I don't see a way of doing that. Is it possible to do? I don't feel like putting in another 20 hours redrawing my images I have started.

Nothing is ever simple, I went down that route, You can try it. Not 100% effective
Layers -> Transparency -> Alpha to selection
Select -> Invert
Edit -> Cut


Nope was not that one it was: Color -> Color-to-Alpha
Click in the white and use the resulting selector to select the 'transparency'

Should have cleared everything but a few traces remained. R 4 G 0 B 2
Reply
#8
So let me get this straight. Once a pixel, like the real problem at 178,95, not the ones you used in your example, once the transparency is set, it can never be painted over with a brush or bucket fill? That appears to be the situation. Since the selection tool works properly since it only looks at the RGB, can I flood fill a new layer based on the selection of a layer below it?

Just tried tried that. It works perfectly. I simply need to create new layers for all the old layers, create a selection on the old layer of the fill area and then bucket fill on the new layer. All of the transparency issues disappear. At least this is only about 15 minutes per image and I only have a few that were started. Thanks for all the info.
Reply
#9
That sample point is at 178, 95 ie. That is the top left corner of the pixel. Otherwise, not sure what you are doing (looks something like that new layer I made in the earlier example, a copy paste into a new gimp transparent layer) but pleased you have found a solution.
Reply


Forum Jump: