Skip to content

Commit

Permalink
README update
Browse files Browse the repository at this point in the history
  • Loading branch information
whatdoineed2do/Ray committed Jan 27, 2024
1 parent 133a1c7 commit fdfe3b2
Showing 1 changed file with 10 additions and 21 deletions.
31 changes: 10 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,7 @@
creates di/tri/n-typch images from input files; scales them so them fit on the final image which can be a specified image size or an image size determined based on image inputs.

## Compiling / Dependancies
This util depends on `ImageMagick` and `exiv2` - to complie:
```
g++ -DGEN_EXIF -DNEED_UCHAR_UINT_T \
$(pkg-config Magick++ --cflags) $(pkg-config exiv2 --cflags) \
diptych.cc \
$(pkg-config Magick++ --libs) $(pkg-config exiv2 --libs) \
-o diptych
```
Remove `-DGEN_EXIF` and references to `pkg-config exiv2` if exif info is not required in the output.
This util depends on `C++ 17`, `ImageMagick` and optionally `exiv2` which will preserving common EXIF amognst the input images onto the final output image.

## Example Usage
### Typical ###
Expand All @@ -26,20 +18,17 @@ diptych -O 300 -B 10 -b 50 -C black -s 1:1 blue.jpg red.jpg -o final.jpg
Resulting in an 300x185 image that is scaled to the requested output (note the size of text on 'red')
![Alt text](doc/final.jpg?raw=true "final.jpg")

To create a vertical dipytch using the same files above, use `-s 2`

### Resizing and adding Borders ###
whilst this can be done with `ImageMagick` directly, getting the syntax correct has always annoyed me. To do the same with this util:
To create a _vertical dipytch_ (stacked on top of each other) using the same files above, use `-s 2`

### Resizing, adding Borders, output quality ###
```
diptych -O 480 -B 20 -b 35 -C white -q 85 original.jpg -o scaled.jpg
diptych \
-O 1000 -B 20 -b 35 -C white -q 85 \
-s 2:1 a.jpg b.jpg c.jpg \
-o x.jpg
```
This will scale (`-O`) the original image to 480pxls on the longest edge which includes the boders as specified. The quality (`-q`) of the image is set of 85%.

### Extended ###
Slightly more complex renderings can be acheived via `-s`.
This will scale (`-O`) the combined images to 480 pixels on the longest edge which includes the boders as specified. The quality (`-q`) of the image is set of 85%. All the `ImageMagick` resize scaling (_filter_) algorithms can be specified when scaling via `-f <IM filter name>`.

```
diptych -O 1024 -B 20 -b 35 -C white -s 2:1 a.jpg b.jpg c.jpg -o x.jpg
```
This will produce a vertical image (stacking `a.jpg` and `b.jpg`) and then using that result to create a horizontal diptypch with `c.jpg` - the output will be scalled so that all images proportions will fit the final out.

We can also specify a single image to scale, resize, add borders etc if desired.

0 comments on commit fdfe3b2

Please sign in to comment.