Skip to content

Commit

Permalink
docs(readme): improve writing; add BSD build instr
Browse files Browse the repository at this point in the history
  • Loading branch information
dbohdan committed Oct 4, 2024
1 parent 1d49402 commit d3f7702
Showing 1 changed file with 33 additions and 7 deletions.
40 changes: 33 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ A jet airplane is taking off in the sky.](bordeaux-15bit.png)

*(The image above has 15-bit color.)*

HiColor is a program and library for converting images to 15- and 16-bit RGB color,
HiColor is a program and a C library for converting images to 15- and 16-bit RGB color,
the color depth of old display modes known as [“high color”](https://en.wikipedia.org/wiki/High_color).
I wrote it because I wanted to create images with the characteristic high-color look.

Expand Down Expand Up @@ -42,9 +42,11 @@ so HiColor can be a less-lossy alternative to the 256-color [pngquant](https://p
Quantizing a PNG file to PNG preserves transparency (but does not quantize the alpha channel).
Conversion to and from the HiColor format does not preserve transparency.

The program is written in C with minimal dependencies and builds as a static binary by default.
The program is written in C with two external dependencies, libpng and zlib, and builds as a static binary.
It is known to work on Linux (aarch64, i386, riscv64, x86_64), FreeBSD, NetBSD, OpenBSD, and Windows 98 Second Edition, 2000 Service Pack 4, XP, 7, and 10.

The library is a single C header file.

## Known bugs and limitations

### Security
Expand All @@ -55,7 +57,7 @@ The vulnerabilities were fixed in version 0.6.0 by switching to libpng.

### PNG file size

PNG files produced by HiColor are not optimized.
PNG files produced by HiColor are not highly optimized.
Run them through [OptiPNG](http://optipng.sourceforge.net/) or [Oxipng](https://github.com/shssoichiro/oxipng) to significantly reduce their size.

### Generation loss
Expand All @@ -74,8 +76,8 @@ HiColor has a Git-style CLI.

The actions `encode` and `decode` convert images between PNG and HiColor's own image format.
`quantize` round-trips an image through the converter and outputs a standard 32-bit PNG.
Use it to create high-color images readable by other programs.
`info` displays information about a HiColor file: version (`5` for 15-bit or `6` for 16), width, and height.
Use `quantize` to create high-color images readable by other programs.
`info` prints information about a HiColor file: version (`5` for 15-bit or `6` for 16), width, and height.

```none
HiColor 0.6.0
Expand Down Expand Up @@ -112,11 +114,36 @@ sudo apt install -y build-essential graphicsmagick tclsh
gmake test
```

### FreeBSD

```sh
sudo pkg install -y gmake GraphicsMagick png pkgconf tcl86
ln -s /usr/local/bin/tclsh8.6 /usr/local/bin/tclsh
fi
gmake test
```

### NetBSD

```sh
sudo pkgin -y install gmake GraphicsMagick png pkgconf tcl zlib
gmake test
```

### OpenBSD

```sh
doas pkg_add -I gmake GraphicsMagick png pkgconf tcl%8.6
ln -s /usr/local/bin/tclsh8.6 /usr/local/bin/tclsh
gmake test
```

### Windows

Install [MSYS2](https://www.msys2.org/).
Run the following commands in the MSYS2 mingw32 shell
to build an x86 executable for Windows.
in a clone of the HiColor repository.
This will build an x86 executable for Windows.

```sh
pacman -Syuu make mingw-w64-i686-gcc mingw-w64-i686-libpng mingw-w64-i686-pkgconf mingw-w64-i686-zlib tcl
Expand All @@ -126,7 +153,6 @@ make test
## Alternatives

I wrote HiColor because nothing seemed to support high color.
I was wrong about that.
Actually,
[FFmpeg](https://www.madox.net/blog/2011/06/06/converting-tofrom-rgb565-in-ubuntu-using-ffmpeg/),
[GIMP](https://docs.gimp.org/2.10/en/gimp-filter-dither.html),
Expand Down

0 comments on commit d3f7702

Please sign in to comment.