ImageMagick negates image after composite Multiply - image

The servers where I work upgraded some libraries and now I am getting a weird behaviour out of ImageMagick version 6.7.8-9.
I am using the command
composite -compose Multiply bkg.gif overlay.gif output.gif
which used to put overlay.gif, which is a mostly white image, on top of bkg.gif. Now the same thing is happening but bkg.gif is negated! I have tried to change from Multiplyto Screen, which, according to the docs is the same thing but negates both images and back, but the output was the same.
I have worked around this by negating image bkg.gif before doing the same operation but this is not correct and I still have to do this is many scripts that use the same command, so I would like to effectively solve the problem or at least understand it.
Why is this happening? I apologize but I cannot provide the images we are using.

Related

How would I go about swapping different transparent images with others in visual basic 6?

So I have a programming project that I have to do for my school. What I have to do is setup a 2 player dice game. I could have gone the easy way and just display the number of the 2 die, but I was thinking of using images that I made in photoshop instead. However, the problem is that I do not know how to change images in an efficient way.
My first option is using the visibility tag on several images laid on top of eachother and change it accordingly as such
image1.visible = false
image2.visible = true
However, I do not think that is very efficient. Images also do not support changing the image with code from my research.
Secondly, I could use a PictureBox instead, which do support changing the image as the program is running. However, it does not support transparency, and the die images are transparent. Plus it gives me the invalid image file error, I guess due to the transparency in the gif files.
There is also the cheap workaround of me making the background of the images the same as the form background.
So is there a more efficient way I am missing out? I know that the cheap workaround would be the best option for this case, but I would like to have this knowledge for future use like semi-transparent pixels that blend in and such.
And before you ask, no, I cannot use another programming language as visual basic 6 is what my school teaches. Thankfully they are changing it soon, but I am stuck with this for now.
Turns out you CAN change the pictures of Images, while keeping transparency and stretch. I am going to properly show it:
Image1.Picture = LoadPicture("YOURPATHHERE.gif")
This is what I get for believing what I've seen on some forum.
Also, the error of invalid image file was due to the images being corrupted for some reason.

How to convert distort perspecitve leads to "# fatal/mogrify.c/MogrifyImage/1423"

I have to distort some pictures in the perspective way with Imagemagick. One of the four given points in the pictures stay in the same position and the other 3 points should distort around the first point.
In my last researches I only found a solution for the output "convert: Memory allocation failed 'name.jpg'". So I changed the the memory value in my policy.xml to the value of my whole RAM.
If I write
convert building.jpg -matte -virtual-pixel transparent \
-distort Perspective \
'4,126 4,126 7,39 4,39 85,0 100,39 86,127 100,126' \
building_pers.png
in the console (given by my professor), I get the output in the heading.
Now I don't know, what I should do. I hope you can help me.
P.S.: I have some difficulties with English, so I hope you can forgive my possible mistakes. Please answer in a way easy to understand.
Thank you very much.
With Imagemagick 7, you must change "convert" to "magick". Try that. Also does your Imagemagick version list jpg for a delegate? Check by magick -version and report all that is returned. How big is your image? Remove -matte. That was deprecated in Imagemagick 7. It should not be needed in your command. Your code is Unix syntax and not for plain Windows.
Try removing all \ and make one long command line as follows in a normal Window terminal. If you are in a Windows Unix terminal, you would have had to install a Unix version of Imagemagick.
So in normal Windows, try
magick.exe building.jpg -virtual-pixel transparent -distort Perspective '4,126 4,126 7,39 4,39 85,0 100,39 86,127 100,126' building_pers.png

Scale PostScript Image via GhostScript

I have a postscript image, which I wanted to scale down to 84x84 pixels.
I tried the following line ( and different ones, but this one is the furthest I got ):
gs -sOutputFile=somefile.bmp -sDEVICE=bmpgray -q -g84x84 -dDEVICEWIDTH=84 -dDEVICEHEIGHT=84 -dPDFFitPage frames/frame_00000055.ps
This did not achieve what I wanted (all it does is showing a white image).
You have several problems with that command line. There is no command line switch -dDEVICEHEIGHT or -dDEVICEWIDTH, the relevant switches are -dDEVICEHEIGHTPOINTS and -dDEVICEWIDTHPOINTS. You should never attempt to set the media size in two different ways anwyay, it will only lead to problems of some kind. You've specified -dPDFFitPage, but you appear to have supplied a PostScript program as the input.
Unsurprisingly, the PDFFitPage parameter does not scale PostScript.
When you are having problems of any kind, its best not to mute the application using -q (for quiet), in case its trying to tell you something.
Try using -dFitPage instead of -dPDFFitPage. If that still doesn't work, then I'll need to see your PostScript program.
84x84 pixels is tiny, its entirely conceivable that the result of downscaling a PostScript program could result in no pixel centers being touched, in which case the output will indeed be blank.

Merge two pngs via command line tool in windows?

I'm looking for a tool I can use via command line (windows 7) to merge two equally sized pngs. I'm not having much luck with search so far as most tools I've seen are pretty heavy applications which don't seem to target simple manipulations.
I want to overwrite the bits in the opaque base image with the non-transparent pixels in the overlay image. I have photoshop CS4 as well, but haven't had much luck in finding the relevant command line arguments.
ImageMagick has a command line tool called composite which will do what you want. Distributions available for Windows, Mac, Linux etc. I've just tested it with two transparent PNGs and works as expected.
composite foreground.png background.png newimage.png

Mysterious PNG RGB+Alpha image that works with IE6

http://moztw.org/images/product-front-thunderbird.png
I am sure that this is a PNG image in RGB colors and a alpha channel (look at the shadow below the icon), but this file mysteriously works with IE6 w/o any special CSS hack (though it seems the alpha channel is being replaced by 2-bit mask in IE6).
Can anyone tell me exactly what information is in the file? It would be even better if someone could give a guidance on how to create such file. Thanks.
Edit: Friends at moztw.org added script hack to the website, so the above statement is no longer verifiable. But your are still welcome to investigate the image format.
That's PNG8+alpha. Explanation and examples in "PNG that works" article.
You can generate such files with pngquant (on a Mac, ImageAlpha is a GUI for it).

Resources