I managed to make tiles with ImageMagick like this:
-size 900x900 tile:D:\tile.jpg D:\tiles.jpg
But i want to resize the image before the tiling (300*300px) - and then maybe afterwards apply a sharpen, but the most important is the resizing.
How do i do that in one command line?
Work from a simple command like this...
convert D:\tile.jpg -resize 300x300 -write mpr:tiler +delete ^
-size 900x900 tile:mpr:tiler -sharpen 0x2 D:\tiles.jpg
That starts by reading in your "tile.jpg" image and resizes it to 300x300. Then it writes that resized image to an ImageMagick built-in memory register named "mpr:tiler" and deletes it from the current list. (You can name it "mpr:almost_anything".)
Next the command sets a canvas size of 900x900 and creates a tiled canvas filled with that "mpr:tiler" image.
You can add sharpening and other operations after reading in the input image and before writing it to the memory register, or after creating the tiled image and before writing it to an output file.
The command above is in Windows syntax. To run it in *nix change that continued-line caret "^" to a backslash "\". If you're using ImageMagick v7 replace "convert" with "magick".
Related
I am trying to run GIMP using console commands. All I want it to do is rotate an image 90 degrees. I added GIMP to my environmental variables so that I can call it from a console window. I also put the picture I want to rotate in my root console directory to make it easy to open.
I read the GIMP Batch Mode guide and came up with this command:
gimp-2.10 -i -b '(gimp-image-rotate plot.png 0)' -b '(gimp-quit)'
The "0" after "plot.png" is supposed to tell it to rotate 90 degrees. This opens a GIMP output window and outputs two messages saying "batch command executed successfully". However, it never rotates the image.
Any idea why the command I have entered is not working?
gimp-image-rotate rotates a loaded image and not a file that contains an image. So you have to
obtain an image by loading it from a file (see the gimp-file-load or gimp-file-{type}-load calls),
rotate the image,
save the result (gimp-file-{type}-save (caution: these calls save a layer, not the whole image)).
But for simple manipulations you are better off using a toolbox designed to be called from scripts such as ImageMagick:
magick mogrify -rotate 90 plot.png
I want to add a pattern repeated image as the background of another image that has spaces around. For example i have the pattern 200x200 and an image 1200x800. I have accomplished to add a background color.
The command i'm using to add a background color
convert -background "#333" -resize 768x450 -gravity Center -extent 768x450
Now i need to add a pattern instead of that color. Some suggest that i should make the pattern as one image with the maximum size then use it to add it as background image.
Is it possible to do it with convert or any other command using ImageMagick ?
Not sure what you mean, but I am guessing it's this. Let's make a 200x200 tile to start off with:
convert -size 200x200 radial-gradient:red-blue t200x200.png
And now you want to make a 1200x800 image by tiling that basic unit:
convert -size 1200x800 tile:t200x200.png BigBoy.png
If you now want to overlay a fine-art, high-quality, centred portrait over the top of your harmonious, subtle background, you can do this:
convert -size 1200x800 tile:t200x200.png -gravity center smiley.gif -composite BigBoy.png
I am attempting to make a very simple label using Libreoffice Draw v 4.0.2.2. The label has not much more to it than regularly spaced lines of centered text
This image will be printed, and I have a fixed size/ppi requirement to ensure appropriate print quality.
I set the page size to my specs, and layout the text as I desire. The print shop takes several image formats including .tiff and .png. When I export the image, a dialog pops up that asks for the image size/ resolution. The given ppi is very low (~40) and I require a minimum of 180ppi. When I enter this, the image size adjusts itself and results in an image that is far too small.
The only solution that appears to be viable is to explode the page size and the drawing text size so it gets shrunk upon export. This is a very imprecise and illogical feature (bug?) of the program that I really wish is a result of my ignorance.
I found a thread in the mailing list which describes this issue exactly. The only answer that is given is essentially "yes, this is ridiculous and doesn't help anybody".
Can anyone give some advice to this? Or at least shed some light on who might need this "feature"?
There is something off about the Export tool of LibreOffice in general. It has been years since it is broken. Taking a screenshot is an alternative, but obviously you cannot control the resolution.
So, a better work around is exporting to SVG, and then convert the SVG to PNG with Inkscape. Once downloaded, convert the file with the following command:
inkscape -z -e out.png -w 1024 in.svg
If you are in Windows (x64), you will need to indicate the full path:
"C:/Program Files/Inkscape/inkscape.exe" -z -e out.png -w 1024 in.svg
If you install the 32 bit version, this should work:
"C:\Program Files (x86)/Inkscape/inkscape.exe" -z -e out.png -w 1024 in.svg
This can be done from inside Libre Office, there is no need to use any external tool. The Export dialog is very confusing, yes; you have to realize that both size and resolution can be set independently.
Select File -> Export -> choose the desired format. The export dialog should appear.
TAKE NOTE of Width and Height. Set the desired resolution; notice how Width and Height change (?). Don't worry, restore Width and Height to your saved values. And that's it. You get a high resolution image with the desired size and DPI.
Libre Draw (the one I'm using anyway) is a vector drawing app - have you asked the print shop if they can use vector formats like eps, pdf? Most should be able to in my experience. Then resolution becomes irrelevant.
-Terry
I am converting eps (Encapsulated PostScript) files to jpeg files with ghostscript. A sample command I use is:
gswin32.exe -sDEVICE=jpeg -dJPEGQ=100 -dNOPAUSE -dBATCH -dSAFER -r600x600 -dGraphicsAlphaBits=4 -dUseCIEColor -dEPSCrop -sOutputFile=”a.jpeg” b.eps
The input eps files come with white backgrounds (I only have their clipping path). What I need to do is change this white background to another color in the output images, or it would be even better if I could make them transparent (output file format would be png). How can I do this?
never tried it myself but you should be able to convert your eps file into png by setting:
-sDEVICE=pngalpha
also the pngalpha device has a -dBackgroundColor option:
-dBackgroundColor=16#RRGGBB (RGB color, default white = 16#ffffff) For
the pngalpha device only, set the
suggested background color in the PNG
bKGD chunk. When a program reading a
PNG file does not support alpha
transparency, the PNG library converts
the image using either a background
color if supplied by the program or
the bKGD chunk. One common web browser
has this problem, so when using on a web page you
would need to use
-dBackgroundColor=16#CCCC00 when creating alpha transparent PNG images
for use on the page.
more details here: Details of Ghostscript output devices see section 3.1. PNG file format
After you've obtained your (white background) images from Ghostscript, you could use ImageMagick's convert or GraphicMagick's gm convert commands to change the white to transparent background:
convert -background transparent my.png my_transp.png
I have a hex (i.e. #FF0000) color and want to generate 50% transparent 50x50 image using imagemagick from command line.
I had to figure out something similar when I was working with CSS 3 and RGBA.
convert -size 50x50 xc:'rgba(255,0,0,0.5)' red_0.5_pixel.png