and 1 contributors


ajpegtran - Transform an Animated JPEG (AJPEG) in various ways


  ajpegtran [options] <input-file> [output-file]


This script relies on jpegtran, so make sure its available and working, on Debian/Ubuntu that would be by having libjpeg installed.


--left, --right, --top, --bottom

This is the meat of this script: crop each frame in an animated JPEG and keep only the stated part of the frame. For example, --left will split a frame into two equal parts and keep the left one.

Appends "-crop" to input file's basename.


Splits the canvas vertically into three equal parts and keeps the middle one.

Appends "-crop" to input file's basename.

--midleft, --midright

Keeps are more left-ish, right-ish part of the animation.

Appends "-crop" to input file's basename.


Flag. Tells ajpegtran to adjust the file modification timestamp (mtime) of the output-file to be the same as the mtime of the input-file.

--force, -f

Flag. Force overwriting of an existing output file.

--debug, -d

Flag. Switch debug output on.


  $ ajpegtran --keep-mtime input.ajpeg output.gif

When the output file is omitted, ajpegtran will write to a file with the suffix .gif and the input file's basename:


More information about how an Animated JPEG differs from animated GIF files can be found in the documentation of the backend module Image::Animated::JPEG and the official AJPEG specs bundled with this distribution.


Clipland GmbH


Copyright 2012-2017 Clipland GmbH. All rights reserved.

This library is free software, dual-licensed under GPLv3/AL2. You can redistribute it and/or modify it under the same terms as Perl itself.