ethumb
ethumb ("efron's thumbnail") is a small tool to pre-process jpg and png images to create thumbnail output.
installation (library):
go get gitlab.com/efronlicht/ethumb/thumbnail@latest
installation (program):
go install gitlab.com/efronlicht/ethumb@latest
#!/usr/bin/env bash
# in a directory with a go.mod file...
go get -tool gitlab.com/efronlicht/ethumb/thumbnail@latest
# then use with
go tool ethumb [-flag=value] path/to/file
usage
Usage of ethumb
-border int
size of border, in pixels (default 5)
-bordercolor value
color of the border (default white), as hex RGBA value (i.e, RRGGBBAA), e.g, 0xff0000ff for opaque red
-dither
floyd-steinburg dither to reduce the color depth and further reduce file size
-dst string
destination directory (default ".")
-force
force overwrite destination files even if they already exist
-printmarkdown
print markdown links for thumbnails
-size int
max dimension to scale to (default 320)
-suffix string
added destination file suffix before .png: e.g, input_thumb.png (default "_thumb")
example: generate the thumbnail and literal markdown for this readme :
#!/usr/bin/env bash
ethumb -printmarkdown -size 320 -suffix thumb_320 aa_cover.png
stderr
thumb: thumbnail.go:83: aa_cover.png [8213 KiB] -> aa_cover_thumb_320.png [103 KiB]:
stdout
[](aa_cover.png)
Or in other words...
