Odd imagemagick convert behavior - imagemagick-convert

I'm seeing some really strange behavior w/the imagemagick convert command. I have an image raw.gif. I then run:
convert raw.gif convert.png
And the output in convert.png appears to be shrunk and shifted. However, if I run:
convert raw.gif convert.jpg
convert convert.jpg convert_jpg.png
All images are below.
convert_jpg.png looks exactly like raw.gif which I would expect. I am sure I am missing something obvious but can't figure it out for the life of me.
raw.gif
convert.png
convert.jpg
convert_jpg.png

Related

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

RGB to CMYK Conversion and Mask/Crop - Photoshop

This may sound like stupid question, but for me it's important.
I don't have much experience with using Photoshop, because Inkscape is perfect for my needs (web). Now I would need to create something and print it. I know that color mode for printing should be CMYK.
Because I am more familiar with Inkscape(that does not support CMYK), can I create PDF in that program and then import it into Photoshop and change color mode to CMYK. Is that valid? It shows that color mode is changed, but is that all? Because this is not for me and I just want to know if person that I wouk this for will not have any problems when it comes to printing. How can I make sure that conversion to CMYK was good?
One more question. In Inkscape I can not crop image, but I can mask or clip it. Basically, image still exist, but you see only portion of it. When it comes to printing will printer print full image or just that portion of it or I will need to crop image?
For most part, when you print an RGB file on your printer, the printer will convert it to CMYK. It's ability to do so "well" will depend on how accurate you need it to be & what color profile it is printing from (sRGB generally turns out better than say AdobeRGB).
The main reason for you to convert a file is so that you can make any fine tune adjustments to the image after the change. So you're not leaving it to the printer to decide and possibly mess up.
I'm not familiar with InkScape so don't know how it'll export said artwork. When you open it in Photoshop however, you will be able to see if it tacked it on there. Then you can crop if need be.
Hope that helps.

ImageMagick negates image after composite Multiply

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.

MATLAB: overwriting images using print function

I'm using the print function in MATLAB to write images of plots, something like that
print(figure(1),'-dpng','-r300',filename);
But apparently the images are not overwritten, and the original images stay. I was using saveas before, which seems to overwrite the images, but print gives me more output options. Any ideas?
UPDATE: I ended up deleting the files before the printing with a different function.
You can use this:
im = frame2im(getframe(gcf,rec)); %Grabs image of plot as an image
imsave(im, filename); %save image
That syntax may not be 100%, its a while since I've used it.
Also be aware that this isn't perfect - I remember having issues with it grabbing a grey border around the edge of the plot. Also, I think the image may be based on a matlab screenshot.... just something to be aware of
Saving figures in matlab is rather troublesome, especially if the saved image should look like the original figure.
For myself i found the solution in using export_fig.
It's one of the most downloaded fileexchange files - maybe you should give it a try:
http://www.mathworks.de/matlabcentral/fileexchange/23629-export-fig
A small introduction to export_fig can be found at:
https://github.com/ojwoodford/export_fig/blob/master/README.md

Same image displaying differently in different browsers

Here is an image:
When I load this image in different browsers, it shows differently.
Take a look at the result:
I spent a lot of time on this, but I can't understand why it happens.
I have only theories: something wrong with color profiles, or bad image structure, or something else - maybe special copyright measures?
Why is this happening?
The image is a CMYK image, which IE and Safari apparently do not support. Converting it into an RGB image solved the problem for both Safari and IE.
RGB Version:
The color's been changed though, so you'd probably want to run it through Photoshop and edit the color balance to get the colors right.
There could be something wrong with the image. Open it in some image editor like GIMP and check if it gives some warnings. Try converting the image to some other format(png?) and see if the browsers render it correctly.

Resources