colors

extract colors from pictures
git clone git://git.2f30.org/colors
Log | Files | Refs | README | LICENSE

commit 777899d64f583f9a141ed7fd48b0330ee41e234c
parent 0ea90f30b132652edbf85c2c3919ddc90855e79f
Author: sin <sin@2f30.org>
Date:   Thu,  4 Jun 2015 15:59:43 +0100

Add manpage

Diffstat:
MMakefile | 15++++++++++++++-
Acolors.1 | 24++++++++++++++++++++++++
Mcolors.c | 2+-
3 files changed, 39 insertions(+), 2 deletions(-)

diff --git a/Makefile b/Makefile @@ -1,9 +1,12 @@ VERSION = 0.1 PREFIX = /usr/local -LDFLAGS = -L/usr/local/lib -lm -lpng +MANPREFIX = $(PREFIX)/man + CPPFLAGS = -I/usr/local/include CFLAGS = -Wall -O3 +LDFLAGS = -L/usr/local/lib -lm -lpng +LDFLAGS = -lm -lpng OBJ = colors.o png.o BIN = colors @@ -15,5 +18,15 @@ $(BIN): $(OBJ) colors.o: arg.h colors.h queue.h png.o: arg.h colors.h queue.h +install: all + mkdir -p $(DESTDIR)$(PREFIX)/bin + cp -f $(BIN) $(DESTDIR)$(PREFIX)/bin + mkdir -p $(DESTDIR)$(MANPREFIX)/man1 + cp -f $(BIN).1 $(DESTDIR)$(MANPREFIX)/man1 + +uninstall: + rm -f $(DESTDIR)$(PREFIX)/bin/$(BIN) + rm -f $(DESTDIR)$(MANPREFIX)/man1/$(BIN).1 + clean: rm -f $(BIN) $(OBJ) diff --git a/colors.1 b/colors.1 @@ -0,0 +1,24 @@ +.Dd June 4, 2015 +.Dt COLORS 1 +.Os +.Sh NAME +.Nm colors +.Nd extract colors from pictures +.Sh SYNOPSIS +.Nm colors +.Op Fl e +.Op Fl n Ar clusters +.Ar file +.Sh DESCRIPTION +.Nm +is a simple tool that uses k-means clustering to extract dominant colors +from pictures. +.Sh OPTIONS +.Bl -tag -width Ds +.It Fl e +Print empty clusters as well. +.It Fl n Ar clusters +.El +Set the number of clusters. It defaults to 4. +.Sh AUTHORS +.An Dimitris Papastamos Aq Mt sin@2f30.org diff --git a/colors.c b/colors.c @@ -196,7 +196,7 @@ printclusters(void) void usage(void) { - fprintf(stderr, "usage: %s [-e] [-n clusters] png-file\n", argv0); + fprintf(stderr, "usage: %s [-e] [-n clusters] file\n", argv0); fprintf(stderr, " -e\tinclude empty clusters\n"); fprintf(stderr, " -n\tset number of clusters, defaults to 4\n"); exit(1);