commandlinefu.com is the place to record those command-line gems that you return to again and again.
You can sign-in using OpenID credentials, or register a traditional username and password.
Subscribe to the feed for:
This command will resize an image (keeping the aspect ratio) to a specific resolution, meaning the resulting image will never be smaller than this resolution.
For example, if we have a 2048x1000 image, the output would be 1229x600, not 1024x600 or 1024x500. Same thing for the height, if the image is 2000x1200, the output would be 1024x614.
Requires ImageMagick to be installed.
This command was stolen from @climagic on Twitter.
Probably a duplicate of command below, but this command uses slightly higher quality.
- Backup data before reszie as it over write original
-To preserve aspect ratio remove !
Create transparent image to use as icon, watermark for other images, etc.
Compose 2 images (foreground.jpg with background.jpg) into 1 (image.jpg), the numeric parameters stablish the size of the foreground.jpg image (96x96) and the position x,y (+250+70) relative to the background.jpg image.
Images can be any format, jpg, png, bmp, etc...
convert -crop 51x34 +repage http://www.google.com/images/flags/sprite_flag-50.png flag.png
Deletes unneeded files after every step and allows to use a color other than yellow at the last position.
Yes, You could do it in the GIMP or even use Inkscape, but the command line is so much easier.
This is a new version of a previous command fixing some things complained about.
use imagemagik convert
Removes all png files whose geometry is not 280x190 pixels
If you skip this part:
you'll get a very lo-res image.
like 7300, but doesn't clutter your working directory with old qr.*.png files. This will get the QR barcode, and send it right into ImageMagick's 'display' tool. Usage is the same as 7300; just call this function followed by the URL:
Given some images (jpg or other supported formats) in input, you obtain a single PDF file with an image for every page.