find . -name '*.jpg' -print | castle-image-viewer.exe @-
|
Note
|
If you already have Castle Game Engine, then just run castle-image-viewer executable from the engine bin subdirectory. There’s no need to download this separately.
|
Load and save many image formats, including some "exotic" ones: KTX, DDS, RGBE. Detailed list below.
Easily scale and move the image (use keys, mouse dragging, mouse wheel).
Browse all the images within a single directory (use keys Page Up, Page Down).
Test how image looks tiled (repeatable) (to test is it good for a repeatable texture).
See how alpha channel of the image looks (menu items "View → Use Image Alpha Channel", "View → Background Color"),
Edit image to mirror, rotate, resize, make grayscale and so on.
Perform alpha bleeding (fixes the artifacts when scaling textures with transparent parts).
You can browse all subimages (like mipmaps, or layers of 3D textures) within a composite image formats (like KTX, DDS).
Excellent open format for images, offering good lossless image compression, full alpha channel (i.e. partial transparency using blending), high-precision (16-bit) data if necessary, supported by almost every image software in the world.
Loaded using LibPNG for maximum efficiency. The code has a fallback (in case LibPNG is missing) on Pascal loader from Vampyre Imaging Library.
Common image formats, supported by many tools.
These formats are loaded using Vampyre Imaging Library, eventually native support or fcl-image.
|
Note
|
For most of the above image formats, PNG is a better alternative, and we recommend it over the "common image formats" listed above. Some reasons:
|
Khronos Texture Format. Excellent image format to utilize various graphic features, like GPU compression (images stay compressed in GPU memory), explicit mipmaps, cube maps, volume (3D) textures, various data precision (8-bit int, 16-bit int, 32-bit float), super-fast loading and saving in many cases.
With Castle Image Viewer you can view all subimages within one DDS file, see menu items "Images → Next/Previous Subimage in composite (DDS, KTX)".
Direct Draw Surface. Similar to KTX, but older. Saving to DDS is also supported. If you can, we recommend to use KTX instead of DDS for new applications, as KTX offers even more features that map to GPU usage in a straightforward way.
Simple HDR (high dynamic range) format.
The format name is an acronym for Red + Green + Blue + Exponent, it was developed by by Greg Ward, described in "Graphic Gems II", used e.g. in Radiance.
It makes sense to use this if you need data in floating-point format, e.g. to load it to TRGBFloatImage.
Most of the key bindings are available as menu items. Below are the only exceptions:
ArrowsMove image.
Arrows + CtrlMove image 10 x faster.
- +Scale image.
x XScale image only horizontally.
y YScale image only vertically.
Image viewer maintains an image list that you can browse using Page Up / Page Down. Using the command-line options you can specify the list of images to display.
Every command-line parameter must be one of:
Display all images found in the given directory.
E.g. castle-image-viewer ~/my_images/ displays all images in ~/my_images/ directory.
Display this image and browse other images in the same directory.
@<filename>Read image filenames from file <filename>, each line is one filename.
<filename> equals - means "standard input", as usual, so you can pipe output of e.g. find program to castle-image-viewer like this:
find . -name '*.jpg' -print | castle-image-viewer.exe @-
Running castle-image-viewer with no parameters opens all images in the current directory.
If none found, the default welcome image will be displayed.
All standard options understood by our GUI programs and all standard options understood by all our programs are handled as well.
Resulting image format is determined by the filename extension. Unknown extension will result in an error.
GPU-compressed images (like with S3TC compression) will be decompressed at load by this application, and saving them back will make images without GPU compression.
|
Note
|
The above is just a quirk of this application Castle Image Viewer, as we need to decompress GPU-compressed data to enable some editing operations on CPU. In general, using [Castle Game Engine](https://castle-engine.io/) API you can load and save GPU-compressed images, keeping them compressed, if you wish. |
To improve this documentation just edit this page and create a pull request to cge-www repository.