Skip to content

Instantly share code, notes, and snippets.

@bivihoba
Created October 13, 2017 09:02
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bivihoba/d769a724f456586445160c6a7088e762 to your computer and use it in GitHub Desktop.
Save bivihoba/d769a724f456586445160c6a7088e762 to your computer and use it in GitHub Desktop.
Potrace Sandbox Dockerfile
FROM alpine:3.6
RUN apk add --no-cache --update gcc make automake autoconf libtool musl-dev zlib-dev git openssl nodejs nodejs-npm imagemagick
RUN git clone https://github.com/skyrpex/potrace.git && \
cd potrace && \
autoreconf -i && \
./configure && make && make install
RUN npm install -g svgo
RUN mkdir /sandbox
WORKDIR /sandbox
# Usage
# docker build -t bivihoba/potrace .
# docker run --rm -it --name potrace -v $(pwd):/sandbox bivihoba/potrace /bin/sh
# convert original.jpg temp.svg
# potrace -s temp.ppm -o temp.svg --color=#cccccc --flat -u 1 --longcoding --turdsize=100 --opttolerance 0.4 --turnpolicy majority
# svgo temp.svg original.svg
# Credits
# https://twitter.com/Martin_Adams/status/918481948217049088
# https://twitter.com/mikaelainalem/status/918213244954861569
# See Also
# https://gist.github.com/bivihoba/7e615e8c0b4485ff284778977240fbb9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment