PhotoClip
PhotoClip is a simple image viewer and editor mostly designed
for digital camera pictures. The plan is to make a program
with elegant and intuitive interface which at the same time will
be powerful enough o be useful. PhotoClip is based on
GNUStep.
That elegance dictates a small set of features. Right now everything
supports just one activity: image recomposition, i.e. selecting,
cropping and scaling of the image fragments.
The latest release is 0.2.5.
Released under the terms of GNU LGPL (Library General Public License).
Changes in this release
-
Starting with release 0.2.3 PhitoClip can save certain TIFF variants.
Now the saving of modified JPEG files has been partially implemented with
external jpegtran program, which performs
Lossless JPEG transformations.
-
The sensitivity of lossless JPEG transforms to fragment's size and position
within original image helped to fix important coordinate bugs.
-
Some key bindings are implemented.
Download
PhotoClip-0.2.5.tar.gz
Installation
-
You need to have GNUstep installed on your machine. Consult
GNUstep documentation how to install GNUstep. I normally build
it from sources with the help of
GNUstep build guide.
Only one backend - libart - is fully supported now. This backend is now built
by default, but you still might want to have finer control over gnustep-back
congifuration. For instance, I usually do
./configure --enable-server=x11 --enable-graphics=art --with-name=art
and then at the very end of GNUstep installation explicitly set the backend
name with
defaults write NSGlobalDomain GSBackend libgnustep-art
-
If you want to use the lossless JPEG saving feature, you need the
jpegtran program that can do crop. Check it with command
jpegtran -crop 8x8+0+0 input-file.jpg > output-file.jpg
Most modern Unix distributions will have crop-capable jpegtran.
Nevertheless, this feature is not included into official release of JPEG
package and might not be on your machine. In that case you would need to
recompile libjpeg youself:
-
Get libjpeg-6b sources, e.g. from
http://www.ijg.org/files/jpegsrc.v6b.tar.gz
and unpack it.
-
Get croppatch.tar.gz from
http://sylvana.net/jpegcrop/croppatch.tar.gz
and unpack it into the libjpeg directory. The croppatch contains
patched files that will replace originals in that directory.
-
Compile and install the package.
-
Current version of PhotoClip does not use configure. For that matter
you need to modify the file LosslessJEPG.h manually.
Open this file with an editor and change the line
#define JPEGTRAN "/usr/bin/jpegtran"
to reflect the full path to jpegtran program in your system.
-
After that you are ready to regular installation process. Compile with
make
-
Become root and install with
make install
Features
-
Depends on GNUstep for image viewing. Your ability to see
various image types will depend on the way you build GNUstep.
By default GNUstep can read at least TIFF, JPEG, PNG, and GIF
formats.
-
The image writing also depends on GNUstep. Right now GNUstep
supports only TIFF format for writing. PhotoClip also supports
lossless JPEG crop and rotations through
external jpegtran program. jpegtran is a part of
libjpeg package.
-
You can select image fragments, rotate to straight angle (90 degrees),
crop and save. When saving you can reduce their size to the given
amount of pixels. Fragments can not be enlarged beyond their original size.
-
Size reduction is implemented on sub-pixel level. See, though,
Bugs for the limitation of this code.
-
You can predefine the aspect ratio for your new fragment.
-
The image is reduced to fit the program's window, but never enlarged.
In common situations the size of the image is significantly larger
than window, and you work with a reduced copy - the sketch. When you save
the fragment, the changes are transferred to the original image. That way
you can work with large images on small screens.
-
You can open a file or a directory. In both cases the program puts
all image file names that exist in corresponding directory to the file ring.
You can then easily move to next or previous image in that directory.
Lossless JPEG transformations
JPEG is a lossy compression format, which means that certain amount of
information is discarded during compression process. This gives very high
compression ratio, but after decompression some finer details are lost.
If the user restores the image, modifies it (rotate to 90 degrees, for
instance) and then compresses into JPEG again, more details will be lost
just because the JPEG compression procedure has been applied second time.
Subsequent modifications with decompression/recompression will degrade
image quality even more.
Fortunalely, for several kinds of operations it is possible to rearrange the
JPEG data in the compressed form without decompression and subsequent
recompression. Thus, this manipulations change the image without any
further degradation in image quality. They are called lossless JPEG
transformations.
These operations include rotation to 90 degrees clockwise and counterclockwise,
cropping rectangular areas and reflections. In most cases the edges of the
manipulated region should coinside with JPEG block boundaries (blocks are
usually 8x8 or 16x16 pixels).
If the cropping, 90-degrees rotations and refections are all what user wants,
lossless JPEG transform is the best way to do these operations.
For more details see
http://sylvana.net/jpegcrop/jpegtran
Bugs
There are many obviously missed features. Here are the most apparent ones.
-
Cursor shape changes (rectangle tracking) are very simplistic and
nevertheless buggy.
-
The program does not show information about the
size and orientation of the image or current selection.
Certain features are also missed in the current GNUstep implementation:
-
While many image formats can be loaded, only TIFF works for writing.
Moreover, I did not find a way to save the image that was modified
by affine transformation with the use of standard AppKit methods.
I had to write my own cropping and scaling function. The latter have
limited support for color schemes.
As a result the current output capabilities are TIFF only in
meshed representation with 8, 12 or 16 bits per color.
-
Currnetly the color schema for new fragment is copied from the original
one. This restricts image formats even more, and I was able to test
only RGB images with 8 bits per color.
-
Rotation does not work in Xlib backend, alpha transparency also works poorly
there.
I believe there are more, please report bugs to
tima@vaisburd.net
Acknowledgements
The ImageViewer
by Philippe C.D. Robert and PRICE
by Riccardo Mottola helped me to get started. I got help from may people
on discuss-gnustep mailing list.