undo a composite -dissolve
Posted: 2011-03-07T09:51:56-07:00
I am looking for a way to "undo" this opperation:
50% [over] =
50% star.gif + dragon.gif = combine.png
Given only star.gif and combine.png, how can I reconstruct the image dragon.gif?
i.e.
- = ?
combine.png - star.gif = dragon.gif (how???)
Looking at the image combine.png, all color information of the original dragon.gif is still there, it is merely "tinted" in certain places by the transparently overlayed star.gif. There might be some loss of accuracy because the colors below the star are forced into a smaller range, but aside from that, it should be possible to reconstruct dragon.gif with the information given.
--edit-- p.s.
I tried to express it as a "-compose mathematics" operation. inserting the values for black, white and grey and solving the resulting equations i got something like this:
However first results where confusing; either I miscalculated, or there might be a bug here:
Code: Select all
composite -dissolve 50 -gravity South star.gif dragon_sm.gif combine.png
50% star.gif + dragon.gif = combine.png
Given only star.gif and combine.png, how can I reconstruct the image dragon.gif?
i.e.
- = ?
combine.png - star.gif = dragon.gif (how???)
Looking at the image combine.png, all color information of the original dragon.gif is still there, it is merely "tinted" in certain places by the transparently overlayed star.gif. There might be some loss of accuracy because the colors below the star are forced into a smaller range, but aside from that, it should be possible to reconstruct dragon.gif with the information given.
--edit-- p.s.
I tried to express it as a "-compose mathematics" operation. inserting the values for black, white and grey and solving the resulting equations i got something like this:
Code: Select all
convert combine.png star.gif -compose Mathematics -define compose:args='0,2,-1,0' -composite dragon_orig.png