Strange "add" behaviour
-
- Posts: 17
- Joined: 2013-08-19T12:04:09-07:00
- Authentication code: 6789
Strange "add" behaviour
As so often - is it a bug or a feature? Or am I just entering the wrong commands? See the bright pixels that weren´t expected.
compose test3.png t1.png -compose add -layers flatten test2.png
Pic one: http://files.homepagemodules.de/b167881 ... 1561n2.png
added to
Pic two: http://files.homepagemodules.de/b167881 ... 1561n3.png
What it shlould look like (Paint.net): http://files.homepagemodules.de/b167881 ... 1561n5.png
What it does look like ImageMagick): http://files.homepagemodules.de/b167881 ... 1561n4.png
Wrong command or wrong calculation?
compose test3.png t1.png -compose add -layers flatten test2.png
Pic one: http://files.homepagemodules.de/b167881 ... 1561n2.png
added to
Pic two: http://files.homepagemodules.de/b167881 ... 1561n3.png
What it shlould look like (Paint.net): http://files.homepagemodules.de/b167881 ... 1561n5.png
What it does look like ImageMagick): http://files.homepagemodules.de/b167881 ... 1561n4.png
Wrong command or wrong calculation?
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Strange "add" behaviour
what version of IM and what platform?
use -compose plus and not -compose add. The latter will wrap around outside the quantrum range of your IM compile.
see
http://www.imagemagick.org/Usage/compose/#plus
http://www.imagemagick.org/Usage/compose/#modulus_add
modulusAdd is the new syntax for add, but the old syntax still works.
use -compose plus and not -compose add. The latter will wrap around outside the quantrum range of your IM compile.
see
http://www.imagemagick.org/Usage/compose/#plus
http://www.imagemagick.org/Usage/compose/#modulus_add
modulusAdd is the new syntax for add, but the old syntax still works.
-
- Posts: 17
- Joined: 2013-08-19T12:04:09-07:00
- Authentication code: 6789
Re: Strange "add" behaviour
Of course I alreday tried using plus. I should have mentioned that. It results in a plane white image with nothing but white at all. *sigh*
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Strange "add" behaviour
What do you hope "-layers flatten", using whichever "-composite" you have specified, will do?
snibgo's IM pages: im.snibgo.com
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Strange "add" behaviour
The first input (I call it pic1.png) is sRGB but the second (pic2.png) is RGB.
This is very close (3%) to Paint.net result:
This is very close (3%) to Paint.net result:
Code: Select all
convert pic1.png pic2.png -compose screen -composite -auto-gamma -colorspace RGB p3s.png
snibgo's IM pages: im.snibgo.com
-
- Posts: 17
- Joined: 2013-08-19T12:04:09-07:00
- Authentication code: 6789
Re: Strange "add" behaviour
Code: Select all
convert pic1.png pic2.png -compose screen -composite -auto-gamma -colorspace RGB p3s.png
Simple change for you - a miracle for me.
-
- Posts: 17
- Joined: 2013-08-19T12:04:09-07:00
- Authentication code: 6789
Re: Strange "add" behaviour
BTW - Problem solved - this thread might better be moved to "Noob questions" or so since it´s no bug.
I do have a more complex question. I am creating skins for World of Tanks an am not content with the quality I produced yet.
See http://wot.langschwert.de
I am trying to go to complete automatic production - there I ran into a few problems since I am forced to use command line operations in good old Dos batches.
In theory it is quite simple.
There is a standard tank skin with no camo: http://files.homepagemodules.de/b167881 ... 1562n2.png
Then there is a shadow map that presents shadow an spares all parts that shouldn´t be painted like rubber an wood an so on: http://files.homepagemodules.de/b167881 ... 1562n3.png
And finally there is a camo pattern: http://files.homepagemodules.de/b167881 ... 1562n4.png
What I was doing till now is to multiply camo pattern an shadow map. That leaves a lot of black areas. http://files.homepagemodules.de/b167881 ... 1563n2.png
Then I used add to merge it with the original skin. The result is not satisfying at all. http://files.homepagemodules.de/b167881 ... 1563n3.png
Complete tank: http://files.homepagemodules.de/b167881 ... 1564n2.png
What I am looking for now is a better way to do it. The parts that are covered with black in the shadow map should remain untouched, and everything else should be covered - and shadowed - by the camo pattern in bright, original colors. How could I achieve this?
And second question: how could I do this using ImageMagick? Most of the command lines still are a mystery to me. Since all this should be done in a batch job there is no room for different parameters for each image, so I know that the results may differ from the source tanks but I have to live with that. It doesn´t have to be perfect but it should be better than all I managed to do myself.
I do have a more complex question. I am creating skins for World of Tanks an am not content with the quality I produced yet.
See http://wot.langschwert.de
I am trying to go to complete automatic production - there I ran into a few problems since I am forced to use command line operations in good old Dos batches.
In theory it is quite simple.
There is a standard tank skin with no camo: http://files.homepagemodules.de/b167881 ... 1562n2.png
Then there is a shadow map that presents shadow an spares all parts that shouldn´t be painted like rubber an wood an so on: http://files.homepagemodules.de/b167881 ... 1562n3.png
And finally there is a camo pattern: http://files.homepagemodules.de/b167881 ... 1562n4.png
What I was doing till now is to multiply camo pattern an shadow map. That leaves a lot of black areas. http://files.homepagemodules.de/b167881 ... 1563n2.png
Then I used add to merge it with the original skin. The result is not satisfying at all. http://files.homepagemodules.de/b167881 ... 1563n3.png
Complete tank: http://files.homepagemodules.de/b167881 ... 1564n2.png
What I am looking for now is a better way to do it. The parts that are covered with black in the shadow map should remain untouched, and everything else should be covered - and shadowed - by the camo pattern in bright, original colors. How could I achieve this?
And second question: how could I do this using ImageMagick? Most of the command lines still are a mystery to me. Since all this should be done in a batch job there is no room for different parameters for each image, so I know that the results may differ from the source tanks but I have to live with that. It doesn´t have to be perfect but it should be better than all I managed to do myself.
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Strange "add" behaviour
It looks as if you've got the basics. Windows script:
The three input colorspaces are sRGB, so no need to convert them.
Another compose method may be better than "Over".
"-gamma 1.5" is a tweak to make it look more like the 3-D image.
Sorry, my time is limited today.
Code: Select all
%IM%convert ^
tank_skin.png ^
tank_camo.png ^
tank_shadow.png ^
-compose Over -composite ^
-gamma 1.5 ^
tank_out.png
Another compose method may be better than "Over".
"-gamma 1.5" is a tweak to make it look more like the 3-D image.
Sorry, my time is limited today.
snibgo's IM pages: im.snibgo.com
-
- Posts: 17
- Joined: 2013-08-19T12:04:09-07:00
- Authentication code: 6789
Re: Strange "add" behaviour
Perfect! Absolutely perfect! May I proclaim you to a demigod on trial?
-
- Posts: 17
- Joined: 2013-08-19T12:04:09-07:00
- Authentication code: 6789
Re: Strange "add" behaviour
Here first results of your kindly given hints. It´s all your fault now.
Just click any of the listed links containing a version number:
http://167881.homepagemodules.de/f42-Ko ... -sets.html
Just click any of the listed links containing a version number:
http://167881.homepagemodules.de/f42-Ko ... -sets.html
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Strange "add" behaviour
Good stuff. Thanks for sharing the results.
snibgo's IM pages: im.snibgo.com
-
- Posts: 17
- Joined: 2013-08-19T12:04:09-07:00
- Authentication code: 6789
Re: Strange "add" behaviour
Things are working great.
I still have a little problem not concerning ImageMagick. Ich have to convert the results do .dds - I use PNG2DDS by EasyConvert. It is working fine but it opens a new window and closes it every time it is started. Since that is every two seconds for about half an hour (batch processing) the computer becomes unusable for that time. Do you have any idea how to keep PNG2DDS from doing so? Just keeping in in the background?
I still have a little problem not concerning ImageMagick. Ich have to convert the results do .dds - I use PNG2DDS by EasyConvert. It is working fine but it opens a new window and closes it every time it is started. Since that is every two seconds for about half an hour (batch processing) the computer becomes unusable for that time. Do you have any idea how to keep PNG2DDS from doing so? Just keeping in in the background?
Re: Strange "add" behaviour
I am working on adding support for writing dds files (DTX1/5) to ImageMagick, I have no idea when this will be finished, might take a couple of weeks or even months.
-
- Posts: 17
- Joined: 2013-08-19T12:04:09-07:00
- Authentication code: 6789
Re: Strange "add" behaviour
Make it just a few hours, just to please me.
Re: Strange "add" behaviour
Making it will probably just take a few hours But I don't know when I will be able to spend time on it so you still have to wait that long.