I prepared this little series of screenshots two years ago. When these pictures were made, I didn’t know anything about fancybox, so I just shared it using Ubuntu One, which is now dead.1
Now, with fancybox, the effects of these commands can be compared below. Click on the left and right arrows in the pop-up window to see the little difference in spacing.
As can be seen from the slideshow of pictures, the fourth figure resembles the first one the most.
I’ve found a quicker way to crop images. In the past, using GIMP for shrinking pictures would result in an image size larger than using ImageMagick. However, I didn’t know a way to get the coordinates of the image file inside an image viewer, so I couldn’t supply them quickly to ImageMagick’s command line utility. Now, realising that GIMP can be regarded as an image viewer, this problem can be quickly solved.
Finally, with my experience of writing for loops in bash, it didn’t took me long to type this loop.2
$ for i in {1..4}; do convert $i.png -crop 940x615+160+370 $i\_crop.png; done
For the link to the related post in the offical blog, you may go to the first footnote of one of my recent posts in Blog 1: GitHub Page Build Failure. ↩
Refer to Concatenate Loop Variable’s Value and a String in Bash in Blog 1 if you want to know when, why and how I know to put a backslash ‘\’ behind the loop variable. ↩
+[x-pos]+[y-pos]
, I got more
than one image, and needed to delete them except the desired
one.1
When I wrote a post about screendump
, I took a screenshot of TTY1 so
as to prove that the text that followed the screenshot was really
contents in TTY1.2 The width and height of the screenshot was
1280 px and 1024 px respectively. I then used my old way to crop it
to an image with width 520 px and height 230 px, and got similar error
message described in ImageMagick’s examples.3.
In “ImageMagick commands learnt” in Basic Use of
Aptitude, I got four images because I didn’t append +0+0
after 640x512
. ↩
There’s an image cropped with ImageMagick in “Usage” in Record Linux Terminal.
$ convert src.png -crop 512x225+0+0 tty1.png
In “The Missed Image (from a bad crop)” in Examples of ImageMagick Usage (version 6). ↩
If you need to do it using GIMP, you may refer to Make Images With Transparent Background Using GIMP, and More ….
]]>If you want to take a screenshot in GNU/Linux text mode, you may use
fbgrab
to get a PNG file (fbcat
gives you a PPM file).
If you want to illustrate a process with a series of pictures, then you’ll probably need a GIF file. GIMP provides an easy way of creating GIF files by selecting menu items and clicking a few buttons, but for geeks who are used to CLI, this is not the final answer for them.
If your source PNG files are named as [name]%s.png
, then the right
command is:1
$ convert $(for ((a=0; a<700; a++)); do printf -- "-delay 10 \
> [name]%s.png" $a; done;) [result].gif
-delay 10
means that each image is displayed for 0.1s.[name]
: file name of the source PNG files without the ordinal
number.%s
: the n-th PNG file.[result]
: file name of the target GIF file.Without the whitespace between png
and the ending "
, things
won’t work.
If the GIF animation has not been finished and intermediate files need to be saved, don’t use the GIF format, use MIFF instead.2
Creating a GIF animation from PNG files on Unix & Linux Stack Exchange ↩
GIF Animations and Animation Meta-data in Examples of ImageMagick Usage (Version 6) ↩