Image to tiles

Gimp process
Gaussian blur 1-3 px x5
Mode -> Indexed using palette
Mode -> RGB
Save detailed palette image

Enhance -> Despeckle
Edge detect -> Sobel 1.0
Save edge image

Move to larger blocks / pixelate
Enhance -> Despeckle
Save block imag

Inkscape for edge finding
Extensions -> Modify path -> Flatten beziers 2.0
Gives one path with all segments
Path -> Break Apart. Check, clean up.
Save as SVG.

Info on edge detection, link, link,
Making an Inkscape Extension
Inkscape docs: main, SVG, SVG, Python Pillow,
Start from copy of Jitternodes extension.

Save image to blocks as single pixels
Iterate over block pixels
-Add connected pixels to queue.
-Result is blocks with (pixel set, # of pixels, longest edge).

Steps to use Inkscape extensions to tile image:
Have use setup up guidelines using different extensions. Can use this code to have an extension write to a tile config file:
svg_file = self.args[-1]
ttmp_orig = self.document.getroot()
docname = ttmp_orig.get(inkex.addNS(‘docname’,u’sodipodi’))
if docname is None: docname = self.args[-1]
-For a border, tile on one/both sides, tile in from edges or horrizontal/vertical, fanning our from a seed
-Set background color(s)
-Tile background color horizontal / vertical, fanning our from seeds (set seed locations). Could put ‘control cues’ on a second layer.

Also, can tile in pieces, first a border, then another, or highlights, etc. Return tiles on a tile layer. This way the user can delete particularly bad ones, or backup and try a different approach.

For adding a new layer with a path, look to

Image palette
Using ImageMagick, make a montage image of color swatches.
Open in Gimp make image indexed with the correct number of colors.
Duplicate palette, rename, save.
Palette will be in ~/.gimp-2.8/palettes/<name>.gpl

Open mosaic image, index to palette. Save as a png.
Extract palette RBG colors from an image:
convert <mosaic>.png -unique-colors -depth 16 txt:- > palette.txt

Resizing an image. Convert with ‘-sample’ to maintain color palette. Ordinary resizing adds new colors.

Use the Pixelate Effect on Images in GIMP
How to smooth a scanned image using Gimp
Convert a simple image to a vector graphic using GIMP and Inkscape
“XDoG: An eXtended difference-of-Gaussians compendium including advanced image stylization”, pdf
Converting raster pixels to polygons with GDAL python
ArcGIS Raster to Polygon (Conversion)
Straight skeleton
How to compute Straight Skeletons using Python?
Segmentation: A Simple Linear Iterative Clustering (SLIC) Superpixel Tutorial using Python

OpenCV Morphological Transformations
Finding Shapes in Images using Python and OpenCV
Computer Vision Tutorial: A Step-by-Step Introduction to Image Segmentation Techniques (Part 1)
How to detect area of pixels with the same color using OpenCV
scikit-image: Comparison of segmentation and superpixel algorithms
scikit-image: Module: segmentation

Polygon splitting
Divide a polygon by a value

Inkscape extentions

Script extensions
Inkscape extention gallery
How to Write Extensions
inkex package
Inkscape extensions chat

5 Methods of Transforming Images to Mosaic Patterns
-Not directly applicable, more arty.