diff --git a/.gitignore b/.gitignore index cab0117..6edbd15 100644 --- a/.gitignore +++ b/.gitignore @@ -20,5 +20,5 @@ out image2tiles -!image2tiles +!image2tiles/ diff --git a/README.md b/README.md index e101970..c4bbc37 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,13 @@ # image2tiles +[![GoDoc](https://godoc.org/github.com/lvisei/image2tiles?status.svg)](https://pkg.go.dev/github.com/lvisei/image2tiles) +[![Go Report Card](https://goreportcard.com/badge/github.com/lvisei/image2tiles)](https://goreportcard.com/report/github.com/lvisei/image2tiles) +[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) + image2tiles is a tool to cut large image into square tiles, to be used for a interactive tiled viewer. +There are many high-performant viewing of large image available,but cropping and slicing images may be trouble. image2tiles support custom tile size and creates all tiles to be used by map tool like [leaflet](https://lvisei.github.io/image2tiles/leaflet.html), [openlayers](https://lvisei.github.io/image2tiles/openlayers.html) or Other. + ## Command Line ### How to get @@ -38,7 +44,7 @@ Usage: image2tiles -f [-s] [-t] [-b] [-o] Options: -b string - The background color to be used for the tiles (default "#FFF") + The background color to be used for the tiles (default "#ffffff00") -f string Image filename to be convert -o string @@ -57,7 +63,7 @@ go get github.com/lvisei/image2tiles ### Usage -Image into small single tiles +Image into small single tile ```go package main @@ -70,7 +76,7 @@ import ( func main() { converter := image2tiles.NewConverter() - if err := converter.Prepare("image.png", "#ffffff"); err != nil { + if err := converter.Prepare("image.png", "#fff"); err != nil { fmt.Println(err) } @@ -83,7 +89,7 @@ func main() { ``` -Image into small multiple tiles +Image into multiple small tiles ```go package main @@ -96,7 +102,7 @@ import ( func main() { converter := image2tiles.NewConverter() - if err := converter.Prepare("image.png", "#ffffff"); err != nil { + if err := converter.Prepare("image.png", "#00000000"); err != nil { fmt.Println(err) } @@ -109,8 +115,6 @@ func main() { ``` - - ## LICENSE [MIT](./LICENSE) diff --git a/cmd/image2tiles/main.go b/cmd/image2tiles/main.go index 4c27689..e2d44bc 100644 --- a/cmd/image2tiles/main.go +++ b/cmd/image2tiles/main.go @@ -20,7 +20,7 @@ var ( imageFilename = flag.String("f", "", "Image file name") tileSize = flag.Int("s", 512, "The tile height/width") output = flag.String("o", "out/%d/%d-%d.jpg", "Output file pattern") - backgroundColor = flag.String("b", "#FFF", "The background color to be used for the tiles") + backgroundColor = flag.String("b", "#ffffff00", "The background color to be used for the tiles") ) func main() { diff --git a/docs/leaflet.html b/docs/leaflet.html new file mode 100644 index 0000000..953af26 --- /dev/null +++ b/docs/leaflet.html @@ -0,0 +1,35 @@ + + + + + leaflet + + + + + +
+ + + diff --git a/docs/openlayers.html b/docs/openlayers.html new file mode 100644 index 0000000..bb47c54 --- /dev/null +++ b/docs/openlayers.html @@ -0,0 +1,53 @@ + + + + + openlayers + + + + + +
+ + + diff --git a/docs/tiles/0/0-0.png b/docs/tiles/0/0-0.png new file mode 100644 index 0000000..204f824 Binary files /dev/null and b/docs/tiles/0/0-0.png differ diff --git a/docs/tiles/1/0-0.png b/docs/tiles/1/0-0.png new file mode 100644 index 0000000..af3d2b0 Binary files /dev/null and b/docs/tiles/1/0-0.png differ diff --git a/docs/tiles/1/0-1.png b/docs/tiles/1/0-1.png new file mode 100644 index 0000000..8619226 Binary files /dev/null and b/docs/tiles/1/0-1.png differ diff --git a/docs/tiles/1/1-0.png b/docs/tiles/1/1-0.png new file mode 100644 index 0000000..c1f9086 Binary files /dev/null and b/docs/tiles/1/1-0.png differ diff --git a/docs/tiles/1/1-1.png b/docs/tiles/1/1-1.png new file mode 100644 index 0000000..5d7b8f6 Binary files /dev/null and b/docs/tiles/1/1-1.png differ diff --git a/docs/tiles/2/0-0.png b/docs/tiles/2/0-0.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/2/0-0.png differ diff --git a/docs/tiles/2/0-1.png b/docs/tiles/2/0-1.png new file mode 100644 index 0000000..39c4ae5 Binary files /dev/null and b/docs/tiles/2/0-1.png differ diff --git a/docs/tiles/2/0-2.png b/docs/tiles/2/0-2.png new file mode 100644 index 0000000..d47977b Binary files /dev/null and b/docs/tiles/2/0-2.png differ diff --git a/docs/tiles/2/0-3.png b/docs/tiles/2/0-3.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/2/0-3.png differ diff --git a/docs/tiles/2/1-0.png b/docs/tiles/2/1-0.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/2/1-0.png differ diff --git a/docs/tiles/2/1-1.png b/docs/tiles/2/1-1.png new file mode 100644 index 0000000..d943979 Binary files /dev/null and b/docs/tiles/2/1-1.png differ diff --git a/docs/tiles/2/1-2.png b/docs/tiles/2/1-2.png new file mode 100644 index 0000000..952f6cf Binary files /dev/null and b/docs/tiles/2/1-2.png differ diff --git a/docs/tiles/2/1-3.png b/docs/tiles/2/1-3.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/2/1-3.png differ diff --git a/docs/tiles/2/2-0.png b/docs/tiles/2/2-0.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/2/2-0.png differ diff --git a/docs/tiles/2/2-1.png b/docs/tiles/2/2-1.png new file mode 100644 index 0000000..457cf07 Binary files /dev/null and b/docs/tiles/2/2-1.png differ diff --git a/docs/tiles/2/2-2.png b/docs/tiles/2/2-2.png new file mode 100644 index 0000000..070cc30 Binary files /dev/null and b/docs/tiles/2/2-2.png differ diff --git a/docs/tiles/2/2-3.png b/docs/tiles/2/2-3.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/2/2-3.png differ diff --git a/docs/tiles/2/3-0.png b/docs/tiles/2/3-0.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/2/3-0.png differ diff --git a/docs/tiles/2/3-1.png b/docs/tiles/2/3-1.png new file mode 100644 index 0000000..4bed103 Binary files /dev/null and b/docs/tiles/2/3-1.png differ diff --git a/docs/tiles/2/3-2.png b/docs/tiles/2/3-2.png new file mode 100644 index 0000000..e6c9041 Binary files /dev/null and b/docs/tiles/2/3-2.png differ diff --git a/docs/tiles/2/3-3.png b/docs/tiles/2/3-3.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/2/3-3.png differ diff --git a/docs/tiles/3/0-0.png b/docs/tiles/3/0-0.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/3/0-0.png differ diff --git a/docs/tiles/3/0-1.png b/docs/tiles/3/0-1.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/3/0-1.png differ diff --git a/docs/tiles/3/0-2.png b/docs/tiles/3/0-2.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/3/0-2.png differ diff --git a/docs/tiles/3/0-3.png b/docs/tiles/3/0-3.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/3/0-3.png differ diff --git a/docs/tiles/3/0-4.png b/docs/tiles/3/0-4.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/3/0-4.png differ diff --git a/docs/tiles/3/0-5.png b/docs/tiles/3/0-5.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/3/0-5.png differ diff --git a/docs/tiles/3/0-6.png b/docs/tiles/3/0-6.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/3/0-6.png differ diff --git a/docs/tiles/3/0-7.png b/docs/tiles/3/0-7.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/3/0-7.png differ diff --git a/docs/tiles/3/1-0.png b/docs/tiles/3/1-0.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/3/1-0.png differ diff --git a/docs/tiles/3/1-1.png b/docs/tiles/3/1-1.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/3/1-1.png differ diff --git a/docs/tiles/3/1-2.png b/docs/tiles/3/1-2.png new file mode 100644 index 0000000..2bb979e Binary files /dev/null and b/docs/tiles/3/1-2.png differ diff --git a/docs/tiles/3/1-3.png b/docs/tiles/3/1-3.png new file mode 100644 index 0000000..b087666 Binary files /dev/null and b/docs/tiles/3/1-3.png differ diff --git a/docs/tiles/3/1-4.png b/docs/tiles/3/1-4.png new file mode 100644 index 0000000..6d49d06 Binary files /dev/null and b/docs/tiles/3/1-4.png differ diff --git a/docs/tiles/3/1-5.png b/docs/tiles/3/1-5.png new file mode 100644 index 0000000..5d9485b Binary files /dev/null and b/docs/tiles/3/1-5.png differ diff --git a/docs/tiles/3/1-6.png b/docs/tiles/3/1-6.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/3/1-6.png differ diff --git a/docs/tiles/3/1-7.png b/docs/tiles/3/1-7.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/3/1-7.png differ diff --git a/docs/tiles/3/2-0.png b/docs/tiles/3/2-0.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/3/2-0.png differ diff --git a/docs/tiles/3/2-1.png b/docs/tiles/3/2-1.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/3/2-1.png differ diff --git a/docs/tiles/3/2-2.png b/docs/tiles/3/2-2.png new file mode 100644 index 0000000..6acedbb Binary files /dev/null and b/docs/tiles/3/2-2.png differ diff --git a/docs/tiles/3/2-3.png b/docs/tiles/3/2-3.png new file mode 100644 index 0000000..f591fc6 Binary files /dev/null and b/docs/tiles/3/2-3.png differ diff --git a/docs/tiles/3/2-4.png b/docs/tiles/3/2-4.png new file mode 100644 index 0000000..5364eae Binary files /dev/null and b/docs/tiles/3/2-4.png differ diff --git a/docs/tiles/3/2-5.png b/docs/tiles/3/2-5.png new file mode 100644 index 0000000..23f3739 Binary files /dev/null and b/docs/tiles/3/2-5.png differ diff --git a/docs/tiles/3/2-6.png b/docs/tiles/3/2-6.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/3/2-6.png differ diff --git a/docs/tiles/3/2-7.png b/docs/tiles/3/2-7.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/3/2-7.png differ diff --git a/docs/tiles/3/3-0.png b/docs/tiles/3/3-0.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/3/3-0.png differ diff --git a/docs/tiles/3/3-1.png b/docs/tiles/3/3-1.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/3/3-1.png differ diff --git a/docs/tiles/3/3-2.png b/docs/tiles/3/3-2.png new file mode 100644 index 0000000..76ff664 Binary files /dev/null and b/docs/tiles/3/3-2.png differ diff --git a/docs/tiles/3/3-3.png b/docs/tiles/3/3-3.png new file mode 100644 index 0000000..9b4ef37 Binary files /dev/null and b/docs/tiles/3/3-3.png differ diff --git a/docs/tiles/3/3-4.png b/docs/tiles/3/3-4.png new file mode 100644 index 0000000..8b4407e Binary files /dev/null and b/docs/tiles/3/3-4.png differ diff --git a/docs/tiles/3/3-5.png b/docs/tiles/3/3-5.png new file mode 100644 index 0000000..26eba93 Binary files /dev/null and b/docs/tiles/3/3-5.png differ diff --git a/docs/tiles/3/3-6.png b/docs/tiles/3/3-6.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/3/3-6.png differ diff --git a/docs/tiles/3/3-7.png b/docs/tiles/3/3-7.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/3/3-7.png differ diff --git a/docs/tiles/3/4-0.png b/docs/tiles/3/4-0.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/3/4-0.png differ diff --git a/docs/tiles/3/4-1.png b/docs/tiles/3/4-1.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/3/4-1.png differ diff --git a/docs/tiles/3/4-2.png b/docs/tiles/3/4-2.png new file mode 100644 index 0000000..0c45e40 Binary files /dev/null and b/docs/tiles/3/4-2.png differ diff --git a/docs/tiles/3/4-3.png b/docs/tiles/3/4-3.png new file mode 100644 index 0000000..ea547fe Binary files /dev/null and b/docs/tiles/3/4-3.png differ diff --git a/docs/tiles/3/4-4.png b/docs/tiles/3/4-4.png new file mode 100644 index 0000000..726af49 Binary files /dev/null and b/docs/tiles/3/4-4.png differ diff --git a/docs/tiles/3/4-5.png b/docs/tiles/3/4-5.png new file mode 100644 index 0000000..1b2766c Binary files /dev/null and b/docs/tiles/3/4-5.png differ diff --git a/docs/tiles/3/4-6.png b/docs/tiles/3/4-6.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/3/4-6.png differ diff --git a/docs/tiles/3/4-7.png b/docs/tiles/3/4-7.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/3/4-7.png differ diff --git a/docs/tiles/3/5-0.png b/docs/tiles/3/5-0.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/3/5-0.png differ diff --git a/docs/tiles/3/5-1.png b/docs/tiles/3/5-1.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/3/5-1.png differ diff --git a/docs/tiles/3/5-2.png b/docs/tiles/3/5-2.png new file mode 100644 index 0000000..4c48009 Binary files /dev/null and b/docs/tiles/3/5-2.png differ diff --git a/docs/tiles/3/5-3.png b/docs/tiles/3/5-3.png new file mode 100644 index 0000000..8ca5bea Binary files /dev/null and b/docs/tiles/3/5-3.png differ diff --git a/docs/tiles/3/5-4.png b/docs/tiles/3/5-4.png new file mode 100644 index 0000000..7a9aaaa Binary files /dev/null and b/docs/tiles/3/5-4.png differ diff --git a/docs/tiles/3/5-5.png b/docs/tiles/3/5-5.png new file mode 100644 index 0000000..4c70c69 Binary files /dev/null and b/docs/tiles/3/5-5.png differ diff --git a/docs/tiles/3/5-6.png b/docs/tiles/3/5-6.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/3/5-6.png differ diff --git a/docs/tiles/3/5-7.png b/docs/tiles/3/5-7.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/3/5-7.png differ diff --git a/docs/tiles/3/6-0.png b/docs/tiles/3/6-0.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/3/6-0.png differ diff --git a/docs/tiles/3/6-1.png b/docs/tiles/3/6-1.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/3/6-1.png differ diff --git a/docs/tiles/3/6-2.png b/docs/tiles/3/6-2.png new file mode 100644 index 0000000..4ae2581 Binary files /dev/null and b/docs/tiles/3/6-2.png differ diff --git a/docs/tiles/3/6-3.png b/docs/tiles/3/6-3.png new file mode 100644 index 0000000..76a15ba Binary files /dev/null and b/docs/tiles/3/6-3.png differ diff --git a/docs/tiles/3/6-4.png b/docs/tiles/3/6-4.png new file mode 100644 index 0000000..f646d3f Binary files /dev/null and b/docs/tiles/3/6-4.png differ diff --git a/docs/tiles/3/6-5.png b/docs/tiles/3/6-5.png new file mode 100644 index 0000000..62f58d0 Binary files /dev/null and b/docs/tiles/3/6-5.png differ diff --git a/docs/tiles/3/6-6.png b/docs/tiles/3/6-6.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/3/6-6.png differ diff --git a/docs/tiles/3/6-7.png b/docs/tiles/3/6-7.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/3/6-7.png differ diff --git a/docs/tiles/3/7-0.png b/docs/tiles/3/7-0.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/3/7-0.png differ diff --git a/docs/tiles/3/7-1.png b/docs/tiles/3/7-1.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/3/7-1.png differ diff --git a/docs/tiles/3/7-2.png b/docs/tiles/3/7-2.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/3/7-2.png differ diff --git a/docs/tiles/3/7-3.png b/docs/tiles/3/7-3.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/3/7-3.png differ diff --git a/docs/tiles/3/7-4.png b/docs/tiles/3/7-4.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/3/7-4.png differ diff --git a/docs/tiles/3/7-5.png b/docs/tiles/3/7-5.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/3/7-5.png differ diff --git a/docs/tiles/3/7-6.png b/docs/tiles/3/7-6.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/3/7-6.png differ diff --git a/docs/tiles/3/7-7.png b/docs/tiles/3/7-7.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/3/7-7.png differ diff --git a/docs/tiles/4/0-0.png b/docs/tiles/4/0-0.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/4/0-0.png differ diff --git a/docs/tiles/4/0-1.png b/docs/tiles/4/0-1.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/4/0-1.png differ diff --git a/docs/tiles/4/0-10.png b/docs/tiles/4/0-10.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/4/0-10.png differ diff --git a/docs/tiles/4/0-11.png b/docs/tiles/4/0-11.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/4/0-11.png differ diff --git a/docs/tiles/4/0-12.png b/docs/tiles/4/0-12.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/4/0-12.png differ diff --git a/docs/tiles/4/0-13.png b/docs/tiles/4/0-13.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/4/0-13.png differ diff --git a/docs/tiles/4/0-14.png b/docs/tiles/4/0-14.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/4/0-14.png differ diff --git a/docs/tiles/4/0-15.png b/docs/tiles/4/0-15.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/4/0-15.png differ diff --git a/docs/tiles/4/0-2.png b/docs/tiles/4/0-2.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/4/0-2.png differ diff --git a/docs/tiles/4/0-3.png b/docs/tiles/4/0-3.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/4/0-3.png differ diff --git a/docs/tiles/4/0-4.png b/docs/tiles/4/0-4.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/4/0-4.png differ diff --git a/docs/tiles/4/0-5.png b/docs/tiles/4/0-5.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/4/0-5.png differ diff --git a/docs/tiles/4/0-6.png b/docs/tiles/4/0-6.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/4/0-6.png differ diff --git a/docs/tiles/4/0-7.png b/docs/tiles/4/0-7.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/4/0-7.png differ diff --git a/docs/tiles/4/0-8.png b/docs/tiles/4/0-8.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/4/0-8.png differ diff --git a/docs/tiles/4/0-9.png b/docs/tiles/4/0-9.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/4/0-9.png differ diff --git a/docs/tiles/4/1-0.png b/docs/tiles/4/1-0.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/4/1-0.png differ diff --git a/docs/tiles/4/1-1.png b/docs/tiles/4/1-1.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/4/1-1.png differ diff --git a/docs/tiles/4/1-10.png b/docs/tiles/4/1-10.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/4/1-10.png differ diff --git a/docs/tiles/4/1-11.png b/docs/tiles/4/1-11.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/4/1-11.png differ diff --git a/docs/tiles/4/1-12.png b/docs/tiles/4/1-12.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/4/1-12.png differ diff --git a/docs/tiles/4/1-13.png b/docs/tiles/4/1-13.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/4/1-13.png differ diff --git a/docs/tiles/4/1-14.png b/docs/tiles/4/1-14.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/4/1-14.png differ diff --git a/docs/tiles/4/1-15.png b/docs/tiles/4/1-15.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/4/1-15.png differ diff --git a/docs/tiles/4/1-2.png b/docs/tiles/4/1-2.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/4/1-2.png differ diff --git a/docs/tiles/4/1-3.png b/docs/tiles/4/1-3.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/4/1-3.png differ diff --git a/docs/tiles/4/1-4.png b/docs/tiles/4/1-4.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/4/1-4.png differ diff --git a/docs/tiles/4/1-5.png b/docs/tiles/4/1-5.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/4/1-5.png differ diff --git a/docs/tiles/4/1-6.png b/docs/tiles/4/1-6.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/4/1-6.png differ diff --git a/docs/tiles/4/1-7.png b/docs/tiles/4/1-7.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/4/1-7.png differ diff --git a/docs/tiles/4/1-8.png b/docs/tiles/4/1-8.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/4/1-8.png differ diff --git a/docs/tiles/4/1-9.png b/docs/tiles/4/1-9.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/4/1-9.png differ diff --git a/docs/tiles/4/10-0.png b/docs/tiles/4/10-0.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/4/10-0.png differ diff --git a/docs/tiles/4/10-1.png b/docs/tiles/4/10-1.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/4/10-1.png differ diff --git a/docs/tiles/4/10-10.png b/docs/tiles/4/10-10.png new file mode 100644 index 0000000..8df3fa2 Binary files /dev/null and b/docs/tiles/4/10-10.png differ diff --git a/docs/tiles/4/10-11.png b/docs/tiles/4/10-11.png new file mode 100644 index 0000000..69a9287 Binary files /dev/null and b/docs/tiles/4/10-11.png differ diff --git a/docs/tiles/4/10-12.png b/docs/tiles/4/10-12.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/4/10-12.png differ diff --git a/docs/tiles/4/10-13.png b/docs/tiles/4/10-13.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/4/10-13.png differ diff --git a/docs/tiles/4/10-14.png b/docs/tiles/4/10-14.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/4/10-14.png differ diff --git a/docs/tiles/4/10-15.png b/docs/tiles/4/10-15.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/4/10-15.png differ diff --git a/docs/tiles/4/10-2.png b/docs/tiles/4/10-2.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/4/10-2.png differ diff --git a/docs/tiles/4/10-3.png b/docs/tiles/4/10-3.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/4/10-3.png differ diff --git a/docs/tiles/4/10-4.png b/docs/tiles/4/10-4.png new file mode 100644 index 0000000..c0cc0db Binary files /dev/null and b/docs/tiles/4/10-4.png differ diff --git a/docs/tiles/4/10-5.png b/docs/tiles/4/10-5.png new file mode 100644 index 0000000..0982f43 Binary files /dev/null and b/docs/tiles/4/10-5.png differ diff --git a/docs/tiles/4/10-6.png b/docs/tiles/4/10-6.png new file mode 100644 index 0000000..d906501 Binary files /dev/null and b/docs/tiles/4/10-6.png differ diff --git a/docs/tiles/4/10-7.png b/docs/tiles/4/10-7.png new file mode 100644 index 0000000..b9a1237 Binary files /dev/null and b/docs/tiles/4/10-7.png differ diff --git a/docs/tiles/4/10-8.png b/docs/tiles/4/10-8.png new file mode 100644 index 0000000..8125c07 Binary files /dev/null and b/docs/tiles/4/10-8.png differ diff --git a/docs/tiles/4/10-9.png b/docs/tiles/4/10-9.png new file mode 100644 index 0000000..addf847 Binary files /dev/null and b/docs/tiles/4/10-9.png differ diff --git a/docs/tiles/4/11-0.png b/docs/tiles/4/11-0.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/4/11-0.png differ diff --git a/docs/tiles/4/11-1.png b/docs/tiles/4/11-1.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/4/11-1.png differ diff --git a/docs/tiles/4/11-10.png b/docs/tiles/4/11-10.png new file mode 100644 index 0000000..801575f Binary files /dev/null and b/docs/tiles/4/11-10.png differ diff --git a/docs/tiles/4/11-11.png b/docs/tiles/4/11-11.png new file mode 100644 index 0000000..f29f5d8 Binary files /dev/null and b/docs/tiles/4/11-11.png differ diff --git a/docs/tiles/4/11-12.png b/docs/tiles/4/11-12.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/4/11-12.png differ diff --git a/docs/tiles/4/11-13.png b/docs/tiles/4/11-13.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/4/11-13.png differ diff --git a/docs/tiles/4/11-14.png b/docs/tiles/4/11-14.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/4/11-14.png differ diff --git a/docs/tiles/4/11-15.png b/docs/tiles/4/11-15.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/4/11-15.png differ diff --git a/docs/tiles/4/11-2.png b/docs/tiles/4/11-2.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/4/11-2.png differ diff --git a/docs/tiles/4/11-3.png b/docs/tiles/4/11-3.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/4/11-3.png differ diff --git a/docs/tiles/4/11-4.png b/docs/tiles/4/11-4.png new file mode 100644 index 0000000..ff99b38 Binary files /dev/null and b/docs/tiles/4/11-4.png differ diff --git a/docs/tiles/4/11-5.png b/docs/tiles/4/11-5.png new file mode 100644 index 0000000..754491b Binary files /dev/null and b/docs/tiles/4/11-5.png differ diff --git a/docs/tiles/4/11-6.png b/docs/tiles/4/11-6.png new file mode 100644 index 0000000..f9c25e4 Binary files /dev/null and b/docs/tiles/4/11-6.png differ diff --git a/docs/tiles/4/11-7.png b/docs/tiles/4/11-7.png new file mode 100644 index 0000000..a371ad5 Binary files /dev/null and b/docs/tiles/4/11-7.png differ diff --git a/docs/tiles/4/11-8.png b/docs/tiles/4/11-8.png new file mode 100644 index 0000000..4ea0330 Binary files /dev/null and b/docs/tiles/4/11-8.png differ diff --git a/docs/tiles/4/11-9.png b/docs/tiles/4/11-9.png new file mode 100644 index 0000000..1367f75 Binary files /dev/null and b/docs/tiles/4/11-9.png differ diff --git a/docs/tiles/4/12-0.png b/docs/tiles/4/12-0.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/4/12-0.png differ diff --git a/docs/tiles/4/12-1.png b/docs/tiles/4/12-1.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/4/12-1.png differ diff --git a/docs/tiles/4/12-10.png b/docs/tiles/4/12-10.png new file mode 100644 index 0000000..2114d6d Binary files /dev/null and b/docs/tiles/4/12-10.png differ diff --git a/docs/tiles/4/12-11.png b/docs/tiles/4/12-11.png new file mode 100644 index 0000000..311e841 Binary files /dev/null and b/docs/tiles/4/12-11.png differ diff --git a/docs/tiles/4/12-12.png b/docs/tiles/4/12-12.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/4/12-12.png differ diff --git a/docs/tiles/4/12-13.png b/docs/tiles/4/12-13.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/4/12-13.png differ diff --git a/docs/tiles/4/12-14.png b/docs/tiles/4/12-14.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/4/12-14.png differ diff --git a/docs/tiles/4/12-15.png b/docs/tiles/4/12-15.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/4/12-15.png differ diff --git a/docs/tiles/4/12-2.png b/docs/tiles/4/12-2.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/4/12-2.png differ diff --git a/docs/tiles/4/12-3.png b/docs/tiles/4/12-3.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/4/12-3.png differ diff --git a/docs/tiles/4/12-4.png b/docs/tiles/4/12-4.png new file mode 100644 index 0000000..1f51540 Binary files /dev/null and b/docs/tiles/4/12-4.png differ diff --git a/docs/tiles/4/12-5.png b/docs/tiles/4/12-5.png new file mode 100644 index 0000000..6e8b409 Binary files /dev/null and b/docs/tiles/4/12-5.png differ diff --git a/docs/tiles/4/12-6.png b/docs/tiles/4/12-6.png new file mode 100644 index 0000000..a5b5ffc Binary files /dev/null and b/docs/tiles/4/12-6.png differ diff --git a/docs/tiles/4/12-7.png b/docs/tiles/4/12-7.png new file mode 100644 index 0000000..799dea1 Binary files /dev/null and b/docs/tiles/4/12-7.png differ diff --git a/docs/tiles/4/12-8.png b/docs/tiles/4/12-8.png new file mode 100644 index 0000000..d6fb7bd Binary files /dev/null and b/docs/tiles/4/12-8.png differ diff --git a/docs/tiles/4/12-9.png b/docs/tiles/4/12-9.png new file mode 100644 index 0000000..0187856 Binary files /dev/null and b/docs/tiles/4/12-9.png differ diff --git a/docs/tiles/4/13-0.png b/docs/tiles/4/13-0.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/4/13-0.png differ diff --git a/docs/tiles/4/13-1.png b/docs/tiles/4/13-1.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/4/13-1.png differ diff --git a/docs/tiles/4/13-10.png b/docs/tiles/4/13-10.png new file mode 100644 index 0000000..e906d16 Binary files /dev/null and b/docs/tiles/4/13-10.png differ diff --git a/docs/tiles/4/13-11.png b/docs/tiles/4/13-11.png new file mode 100644 index 0000000..69b7f7e Binary files /dev/null and b/docs/tiles/4/13-11.png differ diff --git a/docs/tiles/4/13-12.png b/docs/tiles/4/13-12.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/4/13-12.png differ diff --git a/docs/tiles/4/13-13.png b/docs/tiles/4/13-13.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/4/13-13.png differ diff --git a/docs/tiles/4/13-14.png b/docs/tiles/4/13-14.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/4/13-14.png differ diff --git a/docs/tiles/4/13-15.png b/docs/tiles/4/13-15.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/4/13-15.png differ diff --git a/docs/tiles/4/13-2.png b/docs/tiles/4/13-2.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/4/13-2.png differ diff --git a/docs/tiles/4/13-3.png b/docs/tiles/4/13-3.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/4/13-3.png differ diff --git a/docs/tiles/4/13-4.png b/docs/tiles/4/13-4.png new file mode 100644 index 0000000..3faf915 Binary files /dev/null and b/docs/tiles/4/13-4.png differ diff --git a/docs/tiles/4/13-5.png b/docs/tiles/4/13-5.png new file mode 100644 index 0000000..0169daf Binary files /dev/null and b/docs/tiles/4/13-5.png differ diff --git a/docs/tiles/4/13-6.png b/docs/tiles/4/13-6.png new file mode 100644 index 0000000..54e15a1 Binary files /dev/null and b/docs/tiles/4/13-6.png differ diff --git a/docs/tiles/4/13-7.png b/docs/tiles/4/13-7.png new file mode 100644 index 0000000..6c2ae7c Binary files /dev/null and b/docs/tiles/4/13-7.png differ diff --git a/docs/tiles/4/13-8.png b/docs/tiles/4/13-8.png new file mode 100644 index 0000000..52fcafc Binary files /dev/null and b/docs/tiles/4/13-8.png differ diff --git a/docs/tiles/4/13-9.png b/docs/tiles/4/13-9.png new file mode 100644 index 0000000..c32b2a0 Binary files /dev/null and b/docs/tiles/4/13-9.png differ diff --git a/docs/tiles/4/14-0.png b/docs/tiles/4/14-0.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/4/14-0.png differ diff --git a/docs/tiles/4/14-1.png b/docs/tiles/4/14-1.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/4/14-1.png differ diff --git a/docs/tiles/4/14-10.png b/docs/tiles/4/14-10.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/4/14-10.png differ diff --git a/docs/tiles/4/14-11.png b/docs/tiles/4/14-11.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/4/14-11.png differ diff --git a/docs/tiles/4/14-12.png b/docs/tiles/4/14-12.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/4/14-12.png differ diff --git a/docs/tiles/4/14-13.png b/docs/tiles/4/14-13.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/4/14-13.png differ diff --git a/docs/tiles/4/14-14.png b/docs/tiles/4/14-14.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/4/14-14.png differ diff --git a/docs/tiles/4/14-15.png b/docs/tiles/4/14-15.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/4/14-15.png differ diff --git a/docs/tiles/4/14-2.png b/docs/tiles/4/14-2.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/4/14-2.png differ diff --git a/docs/tiles/4/14-3.png b/docs/tiles/4/14-3.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/4/14-3.png differ diff --git a/docs/tiles/4/14-4.png b/docs/tiles/4/14-4.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/4/14-4.png differ diff --git a/docs/tiles/4/14-5.png b/docs/tiles/4/14-5.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/4/14-5.png differ diff --git a/docs/tiles/4/14-6.png b/docs/tiles/4/14-6.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/4/14-6.png differ diff --git a/docs/tiles/4/14-7.png b/docs/tiles/4/14-7.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/4/14-7.png differ diff --git a/docs/tiles/4/14-8.png b/docs/tiles/4/14-8.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/4/14-8.png differ diff --git a/docs/tiles/4/14-9.png b/docs/tiles/4/14-9.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/4/14-9.png differ diff --git a/docs/tiles/4/15-0.png b/docs/tiles/4/15-0.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/4/15-0.png differ diff --git a/docs/tiles/4/15-1.png b/docs/tiles/4/15-1.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/4/15-1.png differ diff --git a/docs/tiles/4/15-10.png b/docs/tiles/4/15-10.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/4/15-10.png differ diff --git a/docs/tiles/4/15-11.png b/docs/tiles/4/15-11.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/4/15-11.png differ diff --git a/docs/tiles/4/15-12.png b/docs/tiles/4/15-12.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/4/15-12.png differ diff --git a/docs/tiles/4/15-13.png b/docs/tiles/4/15-13.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/4/15-13.png differ diff --git a/docs/tiles/4/15-14.png b/docs/tiles/4/15-14.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/4/15-14.png differ diff --git a/docs/tiles/4/15-15.png b/docs/tiles/4/15-15.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/4/15-15.png differ diff --git a/docs/tiles/4/15-2.png b/docs/tiles/4/15-2.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/4/15-2.png differ diff --git a/docs/tiles/4/15-3.png b/docs/tiles/4/15-3.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/4/15-3.png differ diff --git a/docs/tiles/4/15-4.png b/docs/tiles/4/15-4.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/4/15-4.png differ diff --git a/docs/tiles/4/15-5.png b/docs/tiles/4/15-5.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/4/15-5.png differ diff --git a/docs/tiles/4/15-6.png b/docs/tiles/4/15-6.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/4/15-6.png differ diff --git a/docs/tiles/4/15-7.png b/docs/tiles/4/15-7.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/4/15-7.png differ diff --git a/docs/tiles/4/15-8.png b/docs/tiles/4/15-8.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/4/15-8.png differ diff --git a/docs/tiles/4/15-9.png b/docs/tiles/4/15-9.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/4/15-9.png differ diff --git a/docs/tiles/4/2-0.png b/docs/tiles/4/2-0.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/4/2-0.png differ diff --git a/docs/tiles/4/2-1.png b/docs/tiles/4/2-1.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/4/2-1.png differ diff --git a/docs/tiles/4/2-10.png b/docs/tiles/4/2-10.png new file mode 100644 index 0000000..0ce908d Binary files /dev/null and b/docs/tiles/4/2-10.png differ diff --git a/docs/tiles/4/2-11.png b/docs/tiles/4/2-11.png new file mode 100644 index 0000000..f7f8318 Binary files /dev/null and b/docs/tiles/4/2-11.png differ diff --git a/docs/tiles/4/2-12.png b/docs/tiles/4/2-12.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/4/2-12.png differ diff --git a/docs/tiles/4/2-13.png b/docs/tiles/4/2-13.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/4/2-13.png differ diff --git a/docs/tiles/4/2-14.png b/docs/tiles/4/2-14.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/4/2-14.png differ diff --git a/docs/tiles/4/2-15.png b/docs/tiles/4/2-15.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/4/2-15.png differ diff --git a/docs/tiles/4/2-2.png b/docs/tiles/4/2-2.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/4/2-2.png differ diff --git a/docs/tiles/4/2-3.png b/docs/tiles/4/2-3.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/4/2-3.png differ diff --git a/docs/tiles/4/2-4.png b/docs/tiles/4/2-4.png new file mode 100644 index 0000000..11600ad Binary files /dev/null and b/docs/tiles/4/2-4.png differ diff --git a/docs/tiles/4/2-5.png b/docs/tiles/4/2-5.png new file mode 100644 index 0000000..6e70a1d Binary files /dev/null and b/docs/tiles/4/2-5.png differ diff --git a/docs/tiles/4/2-6.png b/docs/tiles/4/2-6.png new file mode 100644 index 0000000..d0c0eca Binary files /dev/null and b/docs/tiles/4/2-6.png differ diff --git a/docs/tiles/4/2-7.png b/docs/tiles/4/2-7.png new file mode 100644 index 0000000..506ff9f Binary files /dev/null and b/docs/tiles/4/2-7.png differ diff --git a/docs/tiles/4/2-8.png b/docs/tiles/4/2-8.png new file mode 100644 index 0000000..aac2a40 Binary files /dev/null and b/docs/tiles/4/2-8.png differ diff --git a/docs/tiles/4/2-9.png b/docs/tiles/4/2-9.png new file mode 100644 index 0000000..68630e1 Binary files /dev/null and b/docs/tiles/4/2-9.png differ diff --git a/docs/tiles/4/3-0.png b/docs/tiles/4/3-0.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/4/3-0.png differ diff --git a/docs/tiles/4/3-1.png b/docs/tiles/4/3-1.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/4/3-1.png differ diff --git a/docs/tiles/4/3-10.png b/docs/tiles/4/3-10.png new file mode 100644 index 0000000..e545c0f Binary files /dev/null and b/docs/tiles/4/3-10.png differ diff --git a/docs/tiles/4/3-11.png b/docs/tiles/4/3-11.png new file mode 100644 index 0000000..f2c81cc Binary files /dev/null and b/docs/tiles/4/3-11.png differ diff --git a/docs/tiles/4/3-12.png b/docs/tiles/4/3-12.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/4/3-12.png differ diff --git a/docs/tiles/4/3-13.png b/docs/tiles/4/3-13.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/4/3-13.png differ diff --git a/docs/tiles/4/3-14.png b/docs/tiles/4/3-14.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/4/3-14.png differ diff --git a/docs/tiles/4/3-15.png b/docs/tiles/4/3-15.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/4/3-15.png differ diff --git a/docs/tiles/4/3-2.png b/docs/tiles/4/3-2.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/4/3-2.png differ diff --git a/docs/tiles/4/3-3.png b/docs/tiles/4/3-3.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/4/3-3.png differ diff --git a/docs/tiles/4/3-4.png b/docs/tiles/4/3-4.png new file mode 100644 index 0000000..82dac56 Binary files /dev/null and b/docs/tiles/4/3-4.png differ diff --git a/docs/tiles/4/3-5.png b/docs/tiles/4/3-5.png new file mode 100644 index 0000000..df5d403 Binary files /dev/null and b/docs/tiles/4/3-5.png differ diff --git a/docs/tiles/4/3-6.png b/docs/tiles/4/3-6.png new file mode 100644 index 0000000..6c2ee96 Binary files /dev/null and b/docs/tiles/4/3-6.png differ diff --git a/docs/tiles/4/3-7.png b/docs/tiles/4/3-7.png new file mode 100644 index 0000000..d29a94d Binary files /dev/null and b/docs/tiles/4/3-7.png differ diff --git a/docs/tiles/4/3-8.png b/docs/tiles/4/3-8.png new file mode 100644 index 0000000..0b717ae Binary files /dev/null and b/docs/tiles/4/3-8.png differ diff --git a/docs/tiles/4/3-9.png b/docs/tiles/4/3-9.png new file mode 100644 index 0000000..86a0ffe Binary files /dev/null and b/docs/tiles/4/3-9.png differ diff --git a/docs/tiles/4/4-0.png b/docs/tiles/4/4-0.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/4/4-0.png differ diff --git a/docs/tiles/4/4-1.png b/docs/tiles/4/4-1.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/4/4-1.png differ diff --git a/docs/tiles/4/4-10.png b/docs/tiles/4/4-10.png new file mode 100644 index 0000000..15ec8f0 Binary files /dev/null and b/docs/tiles/4/4-10.png differ diff --git a/docs/tiles/4/4-11.png b/docs/tiles/4/4-11.png new file mode 100644 index 0000000..abf8a44 Binary files /dev/null and b/docs/tiles/4/4-11.png differ diff --git a/docs/tiles/4/4-12.png b/docs/tiles/4/4-12.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/4/4-12.png differ diff --git a/docs/tiles/4/4-13.png b/docs/tiles/4/4-13.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/4/4-13.png differ diff --git a/docs/tiles/4/4-14.png b/docs/tiles/4/4-14.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/4/4-14.png differ diff --git a/docs/tiles/4/4-15.png b/docs/tiles/4/4-15.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/4/4-15.png differ diff --git a/docs/tiles/4/4-2.png b/docs/tiles/4/4-2.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/4/4-2.png differ diff --git a/docs/tiles/4/4-3.png b/docs/tiles/4/4-3.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/4/4-3.png differ diff --git a/docs/tiles/4/4-4.png b/docs/tiles/4/4-4.png new file mode 100644 index 0000000..b815db4 Binary files /dev/null and b/docs/tiles/4/4-4.png differ diff --git a/docs/tiles/4/4-5.png b/docs/tiles/4/4-5.png new file mode 100644 index 0000000..4651825 Binary files /dev/null and b/docs/tiles/4/4-5.png differ diff --git a/docs/tiles/4/4-6.png b/docs/tiles/4/4-6.png new file mode 100644 index 0000000..a5dced9 Binary files /dev/null and b/docs/tiles/4/4-6.png differ diff --git a/docs/tiles/4/4-7.png b/docs/tiles/4/4-7.png new file mode 100644 index 0000000..1ddcc11 Binary files /dev/null and b/docs/tiles/4/4-7.png differ diff --git a/docs/tiles/4/4-8.png b/docs/tiles/4/4-8.png new file mode 100644 index 0000000..a7b165c Binary files /dev/null and b/docs/tiles/4/4-8.png differ diff --git a/docs/tiles/4/4-9.png b/docs/tiles/4/4-9.png new file mode 100644 index 0000000..b1c7b54 Binary files /dev/null and b/docs/tiles/4/4-9.png differ diff --git a/docs/tiles/4/5-0.png b/docs/tiles/4/5-0.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/4/5-0.png differ diff --git a/docs/tiles/4/5-1.png b/docs/tiles/4/5-1.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/4/5-1.png differ diff --git a/docs/tiles/4/5-10.png b/docs/tiles/4/5-10.png new file mode 100644 index 0000000..230579c Binary files /dev/null and b/docs/tiles/4/5-10.png differ diff --git a/docs/tiles/4/5-11.png b/docs/tiles/4/5-11.png new file mode 100644 index 0000000..96493c8 Binary files /dev/null and b/docs/tiles/4/5-11.png differ diff --git a/docs/tiles/4/5-12.png b/docs/tiles/4/5-12.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/4/5-12.png differ diff --git a/docs/tiles/4/5-13.png b/docs/tiles/4/5-13.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/4/5-13.png differ diff --git a/docs/tiles/4/5-14.png b/docs/tiles/4/5-14.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/4/5-14.png differ diff --git a/docs/tiles/4/5-15.png b/docs/tiles/4/5-15.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/4/5-15.png differ diff --git a/docs/tiles/4/5-2.png b/docs/tiles/4/5-2.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/4/5-2.png differ diff --git a/docs/tiles/4/5-3.png b/docs/tiles/4/5-3.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/4/5-3.png differ diff --git a/docs/tiles/4/5-4.png b/docs/tiles/4/5-4.png new file mode 100644 index 0000000..f6ebb50 Binary files /dev/null and b/docs/tiles/4/5-4.png differ diff --git a/docs/tiles/4/5-5.png b/docs/tiles/4/5-5.png new file mode 100644 index 0000000..e40ef3b Binary files /dev/null and b/docs/tiles/4/5-5.png differ diff --git a/docs/tiles/4/5-6.png b/docs/tiles/4/5-6.png new file mode 100644 index 0000000..19a2bdd Binary files /dev/null and b/docs/tiles/4/5-6.png differ diff --git a/docs/tiles/4/5-7.png b/docs/tiles/4/5-7.png new file mode 100644 index 0000000..cd413c5 Binary files /dev/null and b/docs/tiles/4/5-7.png differ diff --git a/docs/tiles/4/5-8.png b/docs/tiles/4/5-8.png new file mode 100644 index 0000000..af88f5f Binary files /dev/null and b/docs/tiles/4/5-8.png differ diff --git a/docs/tiles/4/5-9.png b/docs/tiles/4/5-9.png new file mode 100644 index 0000000..e86e6e1 Binary files /dev/null and b/docs/tiles/4/5-9.png differ diff --git a/docs/tiles/4/6-0.png b/docs/tiles/4/6-0.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/4/6-0.png differ diff --git a/docs/tiles/4/6-1.png b/docs/tiles/4/6-1.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/4/6-1.png differ diff --git a/docs/tiles/4/6-10.png b/docs/tiles/4/6-10.png new file mode 100644 index 0000000..4b54678 Binary files /dev/null and b/docs/tiles/4/6-10.png differ diff --git a/docs/tiles/4/6-11.png b/docs/tiles/4/6-11.png new file mode 100644 index 0000000..442a0cd Binary files /dev/null and b/docs/tiles/4/6-11.png differ diff --git a/docs/tiles/4/6-12.png b/docs/tiles/4/6-12.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/4/6-12.png differ diff --git a/docs/tiles/4/6-13.png b/docs/tiles/4/6-13.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/4/6-13.png differ diff --git a/docs/tiles/4/6-14.png b/docs/tiles/4/6-14.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/4/6-14.png differ diff --git a/docs/tiles/4/6-15.png b/docs/tiles/4/6-15.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/4/6-15.png differ diff --git a/docs/tiles/4/6-2.png b/docs/tiles/4/6-2.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/4/6-2.png differ diff --git a/docs/tiles/4/6-3.png b/docs/tiles/4/6-3.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/4/6-3.png differ diff --git a/docs/tiles/4/6-4.png b/docs/tiles/4/6-4.png new file mode 100644 index 0000000..0c43df5 Binary files /dev/null and b/docs/tiles/4/6-4.png differ diff --git a/docs/tiles/4/6-5.png b/docs/tiles/4/6-5.png new file mode 100644 index 0000000..00b3190 Binary files /dev/null and b/docs/tiles/4/6-5.png differ diff --git a/docs/tiles/4/6-6.png b/docs/tiles/4/6-6.png new file mode 100644 index 0000000..1854fde Binary files /dev/null and b/docs/tiles/4/6-6.png differ diff --git a/docs/tiles/4/6-7.png b/docs/tiles/4/6-7.png new file mode 100644 index 0000000..2d2df5d Binary files /dev/null and b/docs/tiles/4/6-7.png differ diff --git a/docs/tiles/4/6-8.png b/docs/tiles/4/6-8.png new file mode 100644 index 0000000..ab7b8af Binary files /dev/null and b/docs/tiles/4/6-8.png differ diff --git a/docs/tiles/4/6-9.png b/docs/tiles/4/6-9.png new file mode 100644 index 0000000..80ed0d4 Binary files /dev/null and b/docs/tiles/4/6-9.png differ diff --git a/docs/tiles/4/7-0.png b/docs/tiles/4/7-0.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/4/7-0.png differ diff --git a/docs/tiles/4/7-1.png b/docs/tiles/4/7-1.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/4/7-1.png differ diff --git a/docs/tiles/4/7-10.png b/docs/tiles/4/7-10.png new file mode 100644 index 0000000..f897802 Binary files /dev/null and b/docs/tiles/4/7-10.png differ diff --git a/docs/tiles/4/7-11.png b/docs/tiles/4/7-11.png new file mode 100644 index 0000000..97873d9 Binary files /dev/null and b/docs/tiles/4/7-11.png differ diff --git a/docs/tiles/4/7-12.png b/docs/tiles/4/7-12.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/4/7-12.png differ diff --git a/docs/tiles/4/7-13.png b/docs/tiles/4/7-13.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/4/7-13.png differ diff --git a/docs/tiles/4/7-14.png b/docs/tiles/4/7-14.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/4/7-14.png differ diff --git a/docs/tiles/4/7-15.png b/docs/tiles/4/7-15.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/4/7-15.png differ diff --git a/docs/tiles/4/7-2.png b/docs/tiles/4/7-2.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/4/7-2.png differ diff --git a/docs/tiles/4/7-3.png b/docs/tiles/4/7-3.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/4/7-3.png differ diff --git a/docs/tiles/4/7-4.png b/docs/tiles/4/7-4.png new file mode 100644 index 0000000..83cf580 Binary files /dev/null and b/docs/tiles/4/7-4.png differ diff --git a/docs/tiles/4/7-5.png b/docs/tiles/4/7-5.png new file mode 100644 index 0000000..e8ccb09 Binary files /dev/null and b/docs/tiles/4/7-5.png differ diff --git a/docs/tiles/4/7-6.png b/docs/tiles/4/7-6.png new file mode 100644 index 0000000..223381f Binary files /dev/null and b/docs/tiles/4/7-6.png differ diff --git a/docs/tiles/4/7-7.png b/docs/tiles/4/7-7.png new file mode 100644 index 0000000..aa62a5c Binary files /dev/null and b/docs/tiles/4/7-7.png differ diff --git a/docs/tiles/4/7-8.png b/docs/tiles/4/7-8.png new file mode 100644 index 0000000..915769e Binary files /dev/null and b/docs/tiles/4/7-8.png differ diff --git a/docs/tiles/4/7-9.png b/docs/tiles/4/7-9.png new file mode 100644 index 0000000..f0dbd21 Binary files /dev/null and b/docs/tiles/4/7-9.png differ diff --git a/docs/tiles/4/8-0.png b/docs/tiles/4/8-0.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/4/8-0.png differ diff --git a/docs/tiles/4/8-1.png b/docs/tiles/4/8-1.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/4/8-1.png differ diff --git a/docs/tiles/4/8-10.png b/docs/tiles/4/8-10.png new file mode 100644 index 0000000..e6371c6 Binary files /dev/null and b/docs/tiles/4/8-10.png differ diff --git a/docs/tiles/4/8-11.png b/docs/tiles/4/8-11.png new file mode 100644 index 0000000..413859d Binary files /dev/null and b/docs/tiles/4/8-11.png differ diff --git a/docs/tiles/4/8-12.png b/docs/tiles/4/8-12.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/4/8-12.png differ diff --git a/docs/tiles/4/8-13.png b/docs/tiles/4/8-13.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/4/8-13.png differ diff --git a/docs/tiles/4/8-14.png b/docs/tiles/4/8-14.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/4/8-14.png differ diff --git a/docs/tiles/4/8-15.png b/docs/tiles/4/8-15.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/4/8-15.png differ diff --git a/docs/tiles/4/8-2.png b/docs/tiles/4/8-2.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/4/8-2.png differ diff --git a/docs/tiles/4/8-3.png b/docs/tiles/4/8-3.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/4/8-3.png differ diff --git a/docs/tiles/4/8-4.png b/docs/tiles/4/8-4.png new file mode 100644 index 0000000..e294932 Binary files /dev/null and b/docs/tiles/4/8-4.png differ diff --git a/docs/tiles/4/8-5.png b/docs/tiles/4/8-5.png new file mode 100644 index 0000000..5b41f93 Binary files /dev/null and b/docs/tiles/4/8-5.png differ diff --git a/docs/tiles/4/8-6.png b/docs/tiles/4/8-6.png new file mode 100644 index 0000000..f06ca1e Binary files /dev/null and b/docs/tiles/4/8-6.png differ diff --git a/docs/tiles/4/8-7.png b/docs/tiles/4/8-7.png new file mode 100644 index 0000000..97be970 Binary files /dev/null and b/docs/tiles/4/8-7.png differ diff --git a/docs/tiles/4/8-8.png b/docs/tiles/4/8-8.png new file mode 100644 index 0000000..b363ddd Binary files /dev/null and b/docs/tiles/4/8-8.png differ diff --git a/docs/tiles/4/8-9.png b/docs/tiles/4/8-9.png new file mode 100644 index 0000000..248eefb Binary files /dev/null and b/docs/tiles/4/8-9.png differ diff --git a/docs/tiles/4/9-0.png b/docs/tiles/4/9-0.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/4/9-0.png differ diff --git a/docs/tiles/4/9-1.png b/docs/tiles/4/9-1.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/4/9-1.png differ diff --git a/docs/tiles/4/9-10.png b/docs/tiles/4/9-10.png new file mode 100644 index 0000000..6b58a8f Binary files /dev/null and b/docs/tiles/4/9-10.png differ diff --git a/docs/tiles/4/9-11.png b/docs/tiles/4/9-11.png new file mode 100644 index 0000000..c4cebc9 Binary files /dev/null and b/docs/tiles/4/9-11.png differ diff --git a/docs/tiles/4/9-12.png b/docs/tiles/4/9-12.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/4/9-12.png differ diff --git a/docs/tiles/4/9-13.png b/docs/tiles/4/9-13.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/4/9-13.png differ diff --git a/docs/tiles/4/9-14.png b/docs/tiles/4/9-14.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/4/9-14.png differ diff --git a/docs/tiles/4/9-15.png b/docs/tiles/4/9-15.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/4/9-15.png differ diff --git a/docs/tiles/4/9-2.png b/docs/tiles/4/9-2.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/4/9-2.png differ diff --git a/docs/tiles/4/9-3.png b/docs/tiles/4/9-3.png new file mode 100644 index 0000000..925a7f6 Binary files /dev/null and b/docs/tiles/4/9-3.png differ diff --git a/docs/tiles/4/9-4.png b/docs/tiles/4/9-4.png new file mode 100644 index 0000000..c8215ba Binary files /dev/null and b/docs/tiles/4/9-4.png differ diff --git a/docs/tiles/4/9-5.png b/docs/tiles/4/9-5.png new file mode 100644 index 0000000..fc9ddd0 Binary files /dev/null and b/docs/tiles/4/9-5.png differ diff --git a/docs/tiles/4/9-6.png b/docs/tiles/4/9-6.png new file mode 100644 index 0000000..b5c5370 Binary files /dev/null and b/docs/tiles/4/9-6.png differ diff --git a/docs/tiles/4/9-7.png b/docs/tiles/4/9-7.png new file mode 100644 index 0000000..8ed1362 Binary files /dev/null and b/docs/tiles/4/9-7.png differ diff --git a/docs/tiles/4/9-8.png b/docs/tiles/4/9-8.png new file mode 100644 index 0000000..052a1f6 Binary files /dev/null and b/docs/tiles/4/9-8.png differ diff --git a/docs/tiles/4/9-9.png b/docs/tiles/4/9-9.png new file mode 100644 index 0000000..b0f8b55 Binary files /dev/null and b/docs/tiles/4/9-9.png differ diff --git a/image2tiles.go b/image2tiles.go index b70ce1c..b28c132 100644 --- a/image2tiles.go +++ b/image2tiles.go @@ -9,6 +9,7 @@ import ( "math" "os" "path" + "strings" ) var ( @@ -36,8 +37,8 @@ func (converter *Converter) Prepare(imageName string, bgColor string) error { return errors.New("open newImage file failed: " + err.Error()) } - originalImageWidth := originalImage.Bounds().Size().X - originalImageHeight := originalImage.Bounds().Size().Y + originalImageWidth := originalImage.Bounds().Dx() + originalImageHeight := originalImage.Bounds().Dy() imageWidth := 1 imageHeight := 1 @@ -47,10 +48,8 @@ func (converter *Converter) Prepare(imageName string, bgColor string) error { imageHeight *= 2 } - r, g, b, a := ParseHexColor(bgColor) - - newImage := imaging.New(imageWidth, imageHeight, color.NRGBA{R: uint8(r), G: uint8(g), B: uint8(b), A: uint8(a)}) - originalImage = imaging.Thumbnail(originalImage, imageWidth, imageHeight, resampleFilter) + fillColor := ParseHexColor(bgColor) + newImage := imaging.New(imageWidth, imageHeight, fillColor) newImage = imaging.Paste(newImage, originalImage, image.Pt((imageWidth-originalImageWidth)/2, (imageHeight-originalImageHeight)/2)) converter.Image = newImage @@ -68,16 +67,23 @@ func (converter *Converter) Tile(level int, size [2]int, quadrant [2]int, effici // crop out the area of interest first, then scale and copy it if efficient { - inverseSize := [2]float64{float64(converter.ImageHeight) / float64(size[0]*scale), float64(converter.ImageHeight) / float64(size[1]*scale)} - topLeft := [2]int{int(float64(quadrant[0]) * float64(size[0]) * inverseSize[0]), int(float64(quadrant[1]) * float64(size[1]) * inverseSize[1])} - bottomRight := [2]int{topLeft[0] + int(float64(size[0])*inverseSize[0]), topLeft[1] + int(float64(size[1])*inverseSize[1])} + inverseSize := [2]float64{ + float64(converter.ImageHeight) / float64(size[0]*scale), + float64(converter.ImageHeight) / float64(size[1]*scale), + } + topLeft := [2]int{ + int(float64(quadrant[0]) * float64(size[0]) * inverseSize[0]), + int(float64(quadrant[1]) * float64(size[1]) * inverseSize[1]), + } + bottomRight := [2]int{ + topLeft[0] + int(float64(size[0])*inverseSize[0]), + topLeft[1] + int(float64(size[1])*inverseSize[1]), + } if inverseSize[0] < 1 || inverseSize[1] < 1 { return nil, fmt.Errorf("requested zoom level (%d) is too high", level) } - fmt.Printf(" crop %s resize %v \n", fmt.Sprintf("%v %v", topLeft, bottomRight), size) - zoomed := imaging.Crop(converter.Image, image.Rect(topLeft[0], topLeft[1], bottomRight[0], bottomRight[1])) zoomed = imaging.Resize(zoomed, size[0], size[1], resampleFilter) @@ -93,8 +99,6 @@ func (converter *Converter) Tile(level int, size [2]int, quadrant [2]int, effici return nil, fmt.Errorf("requested zoom level (%d) is too high", level) } - fmt.Printf("crop(%s).resize(%v)", fmt.Sprintf("%v %v", topLeft, bottomRight), newSize) - zoomed := imaging.Clone(converter.Image) zoomed = imaging.Resize(zoomed, newSize[0], newSize[1], resampleFilter) zoomed = imaging.Crop(zoomed, image.Rect(topLeft[0], topLeft[1], bottomRight[0], bottomRight[1])) @@ -102,6 +106,27 @@ func (converter *Converter) Tile(level int, size [2]int, quadrant [2]int, effici return zoomed, nil } +// saveTile Save tile image +func (converter *Converter) saveTile(img image.Image, level int, quadrant [2]int, imageQuality int, output string) (string, error) { + filePath := fmt.Sprintf(output, level, quadrant[0], quadrant[1]) + + if err := os.MkdirAll(path.Dir(filePath), os.ModePerm); err != nil { + return filePath, fmt.Errorf("create output directory: %v", err) + } + + if isPng := strings.ToLower(path.Ext(filePath)); isPng == ".png" { + if err := SavePNG(filePath, img); err != nil { + return filePath, err + } + } else { + if err := SaveJPG(filePath, img, imageQuality); err != nil { + return filePath, err + } + } + + return filePath, nil +} + // subdivide Recursively subdivide a large image into small tiles func (converter *Converter) subdivide(level int, size [2]int, quadrant [2]int, efficient bool, imageQuality int, output string) (image.Image, error) { if converter.ImageWidth <= size[0]*int(math.Pow(2, float64(level))) { @@ -110,11 +135,8 @@ func (converter *Converter) subdivide(level int, size [2]int, quadrant [2]int, e return nil, err } - filePath := fmt.Sprintf(output, level, quadrant[0], quadrant[1]) - if err := os.MkdirAll(path.Dir(filePath), os.ModePerm); err != nil { - return nil, fmt.Errorf("create output directory: %v", err) - } - if err := SaveJPG(filePath, outImg, imageQuality); err != nil { + filePath, err := converter.saveTile(outImg, level, quadrant, imageQuality, output) + if err != nil { return nil, err } @@ -124,7 +146,7 @@ func (converter *Converter) subdivide(level int, size [2]int, quadrant [2]int, e converter.TileSize = size - fmt.Printf("level %d quadrant %v filePath %s", level, quadrant, filePath) + fmt.Printf("level %d quadrant %v filePath %s \n", level, quadrant, filePath) return outImg, nil } @@ -158,14 +180,13 @@ func (converter *Converter) subdivide(level int, size [2]int, quadrant [2]int, e outImg = imaging.Resize(outImg, size[0], size[1], resampleFilter) - filePath := fmt.Sprintf(output, level, quadrant[0], quadrant[1]) - if err := os.MkdirAll(path.Dir(filePath), os.ModePerm); err != nil { - return nil, fmt.Errorf("create output directory: %v", err) - } - if err := SaveJPG(filePath, outImg, imageQuality); err != nil { + filePath, err := converter.saveTile(outImg, level, quadrant, imageQuality, output) + if err != nil { return nil, err } + fmt.Printf("level %d quadrant %v filePath %s \n", level, quadrant, filePath) + return outImg, nil } diff --git a/image2tiles_test.go b/image2tiles_test.go index 00c8575..1eaed30 100644 --- a/image2tiles_test.go +++ b/image2tiles_test.go @@ -19,7 +19,7 @@ func TestTile(t *testing.T) { converter := image2tiles.NewConverter() imageFilename := "testdata/earth_5568 × 3712.jpg" - if err := converter.Prepare(imageFilename, "#fff"); err != nil { + if err := converter.Prepare(imageFilename, "#00000000"); err != nil { t.Fatal("prepare", err) } @@ -32,10 +32,10 @@ func TestExecute(t *testing.T) { converter := image2tiles.NewConverter() imageFilename := "testdata/earth_5568 × 3712.jpg" - if err := converter.Prepare(imageFilename, "#fff"); err != nil { + if err := converter.Prepare(imageFilename, "#00000000"); err != nil { t.Fatal("prepare", err) } - if err := converter.Execute([2]int{512, 512}, true, 75, "out/%d/%d-%d.jpg"); err != nil { + if err := converter.Execute([2]int{512, 512}, true, 75, "docs/tiles/%d/%d-%d.png"); err != nil { t.Fatal("subdivide", err) } } diff --git a/util.go b/util.go index 898ed44..2956193 100644 --- a/util.go +++ b/util.go @@ -3,6 +3,7 @@ package image2tiles import ( "fmt" "image" + "image/color" "image/draw" "image/jpeg" "image/png" @@ -58,23 +59,25 @@ func ImageToRGBA(src image.Image) *image.RGBA { return dst } -func ParseHexColor(x string) (r, g, b, a int) { +func ParseHexColor(x string) color.RGBA { x = strings.TrimPrefix(x, "#") - a = 255 + c := color.RGBA{R: 255, G: 255, B: 255, A: 255} + if len(x) == 3 { format := "%1x%1x%1x" - fmt.Sscanf(x, format, &r, &g, &b) - r |= r << 4 - g |= g << 4 - b |= b << 4 + fmt.Sscanf(x, format, &c.R, &c.G, &c.B) + c.R |= c.R << 4 + c.G |= c.G << 4 + c.B |= c.B << 4 } if len(x) == 6 { format := "%02x%02x%02x" - fmt.Sscanf(x, format, &r, &g, &b) + fmt.Sscanf(x, format, &c.R, &c.G, &c.B) } if len(x) == 8 { format := "%02x%02x%02x%02x" - fmt.Sscanf(x, format, &r, &g, &b, &a) + fmt.Sscanf(x, format, &c.R, &c.G, &c.B, &c.A) } - return + + return c }