pax_global_header 0000666 0000000 0000000 00000000064 14547552620 0014524 g ustar 00root root 0000000 0000000 52 comment=5f6e955b3f0bd0d042e5832e0dd1697a657f2ad3
png2svg-1.5.4/ 0000775 0000000 0000000 00000000000 14547552620 0013121 5 ustar 00root root 0000000 0000000 png2svg-1.5.4/.github/ 0000775 0000000 0000000 00000000000 14547552620 0014461 5 ustar 00root root 0000000 0000000 png2svg-1.5.4/.github/workflows/ 0000775 0000000 0000000 00000000000 14547552620 0016516 5 ustar 00root root 0000000 0000000 png2svg-1.5.4/.github/workflows/build.yml 0000664 0000000 0000000 00000002016 14547552620 0020337 0 ustar 00root root 0000000 0000000 on: [push, pull_request]
name: Build
env:
GO111MODULE: on
jobs:
test:
strategy:
matrix:
go-version: [1.18.x, 1.19.x, 1.20.x]
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}
- name: Checkout code
uses: actions/checkout@v2
- name: Test
run: go test ./...
test-cache:
runs-on: ubuntu-latest
steps:
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: 1.18.x
- name: Checkout code
uses: actions/checkout@v2
- uses: actions/cache@v2
with:
path: |
~/go/pkg/mod # Module download cache
~/.cache/go-build # Build cache (Linux)
~/Library/Caches/go-build # Build cache (Mac)
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Test
run: go test ./...
png2svg-1.5.4/.gitignore 0000664 0000000 0000000 00000000345 14547552620 0015113 0 ustar 00root root 0000000 0000000 *
!*.*
!*/
*.o
*.swp
*.tmp
*.bak
*.pro.user
*.dblite
*.so
*.swo
*.ao
*.pyc
*.orig
*.pb.go
*~
._*
*.nfs.*
.vscode
*CMakeFiles*
.DS_Store
_obj
_test
_testmain.go
!img/*
cmd/png2svg/*.svg
include.txt
cmd/png2svg/png2svg.*
.DS_Store
png2svg-1.5.4/.ignore 0000664 0000000 0000000 00000000007 14547552620 0014402 0 ustar 00root root 0000000 0000000 vendor
png2svg-1.5.4/LICENSE 0000664 0000000 0000000 00000002672 14547552620 0014135 0 ustar 00root root 0000000 0000000 Copyright 2022 Alexander F. Rødseth
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
png2svg-1.5.4/README.md 0000664 0000000 0000000 00000016524 14547552620 0014410 0 ustar 00root root 0000000 0000000 # png2svg  [](http://godoc.org/github.com/xyproto/png2svg) [](https://goreportcard.com/report/github.com/xyproto/png2svg)
Go module and command line utility for converting small PNG images to SVG Tiny 1.2.
## Features and limitations
* Draws rectangles for each region in the PNG image that can be covered by a rectangle.
* The remaining pixels are drawn with a rectangle for each pixel.
* This is not an efficient representation of PNG images!
* The conversion may be useful if you have a small PNG image or icons at sizes around 32x32, and wish to scale them up and print them out without artifacts.
* The utility is fast for small images, but larger images will take an unreasonable amount of time to convert, creating SVG files many megabytes in size. This could potentially also be used for benchmarking the single-core performance of a CPU.
* The resulting SVG images can be opened directly in a browser like Firefox or Chromium, and may look sharper and crisper than small PNG or JPEG images that are smoothed/blurred by the browser, by default (this can be configured with CSS, though).
* The default crispiness of how SVG images are displayed may be useful for displaying "pixel art" style graphics in the browser.
* Written in pure Go, with no runtime dependencies on any external library or utility.
* Handles transparent PNG images by not drawing SVG elements for the transparent regions.
* For creating SVG images that draws a rectangle for each and every pixel, instead of also using larger rectangles, use the `-p` flag.
## Image Comparison
| 192x192 PNG image (16 colors) | 192x192 SVG image (16 colors) | 192x192 SVG image (optimized with [svgo](https://github.com/svg/svgo)) |
| ----------------------------- | ------------------------------ | ---------------------------------------------------------------------- |
| 8.2 KiB | 193 KiB | 66 KiB |
|  |  |  |
The spaceships are drawn by [wuhu](https://opengameart.org/content/spaceships-1) (CC-BY 3.0).
Try zooming in on the images. Most browsers will keep the SVG image crisp when zooming in, but blur the PNG image.
For keeping PNG images crisp, this CSS can be used, but this is not normally needed for SVG images:
```css
image-rendering: -moz-crisp-edges; /* Firefox */
image-rendering: -o-crisp-edges; /* Opera */
image-rendering: -webkit-optimize-contrast; /* Webkit (non-standard naming) */
image-rendering: crisp-edges;
-ms-interpolation-mode: nearest-neighbor; /* IE (non-standard property) */
```
Right now, Chrome does not support `image-rendering: crisp-edges`, while Firefox does not support `image-rendering: pixelated`. This may change over time, check out the excellent [caniuse.com](https://caniuse.com/css-crisp-edges) page.
Using SVG to get crisp images has the advantage of not relying on CSS that may differ from browser to browser.
Other comparisons:
| 302x240 PNG image | 302x240 SVG image (limited to 4096 colors) | 302x240 SVG (optimized with [svgo](https://github.com/svg/svgo)) |
|----------------------------|--------------------------------------------|------------------------------------------------------------------|
| 176 KiB | 3.1 MiB | 934 KiB |
|  |  |  |
With palette reduction:
| `-n 96` + svgo | `-n 32` + svgo | `-n 16` + svgo | `-n 4` + svgo |
|------------------------------------------|------------------------------------------|------------------------------------------|----------------------------------------|
| 516 KiB | 356 KiB | 369 KiB | 139 KiB |
|  |  |  |  |
Note that fewer colors does not always result in smaller images, because it depends on the shapes of the resulting areas with the same colors, and not just on having few colors.
| 64x64 PNG image | 64x64 SVG image (one rectangle per pixel) | 64x64 SVG image (4096 colors) | 64x64 SVG image (rectangles >1px are colored pink) | 64x64 SVG image (optimized with [svgo](https://github.com/svg/svgo)) |
|------------------------|-------------------------------------------|--------------------------------|----------------------------------------------------|----------------------------------------------------------------------|
| 4.1 KiB | 172 KiB | 74 KiB | | 25 KiB |
|  |  |  |  |  |
The rainforest image is from [Wikipedia](https://en.wikipedia.org/wiki/Landscape).
The Glenda bunny is from [9p.io](https://9p.io/plan9/glenda.html).
## Q&A
**Q:** Why 4096 colors?
**A:** Because representing colors on the short form (`#000` as opposed to `#000000`) makes it possible to express 4096 unique colors.
**Q:** Does this mean that I can make an entire web page in SVG, with photos and everything?
**A:** Yes! This is not the intended use of `png2svg`, but it might work out if the images are kept small.
**Q:** Can I use this for QR codes?
**A:** Yes!
**Q:** Can I use `png2svg` together with `svgo` to create assets for a game that only uses vector graphics?
**A:** Yes! If the images are kept small.
**Q:** Are these questions just made up, or did someone actually ask this?
**A:** Look behind you, a three headed monkey!
## Installation
For Go 1.17 or later:
go install github.com/xyproto/png2svg/cmd/png2svg@latest
## Example usage
Generate an SVG image with as few rectangles as possible (`-o` for "output"):
png2svg -o output.svg input.png
Generate an SVG image with one rectangle per pixel:
png2svg -p -o output.svg input.png
Generate an SVG image where the output is limited to 4096 unique colors (`-l` for "limit"):
png2svg -l -o output.svg input.png
Like above, but with progress information while the image is being generated:
png2svg -v -l -o output.svg input.png
Same as above, but also reduce the number of colors to 32:
png2svg -v -l -n 32 -o output.svg input.png
## Packaging status
[](https://repology.org/project/png2svg/versions)
## General information
* Version: 1.5.4
* Author: Alexander F. Rødseth <xyproto@archlinux.org>
* License: BSD-3
png2svg-1.5.4/TODO.md 0000664 0000000 0000000 00000000553 14547552620 0014213 0 ustar 00root root 0000000 0000000 # TODO
- [ ] Make the distinction between 4096 colors and color quantization clearer in the code.
- [ ] Combine rectangles that are next to each other, and of the same color, into polygons.
- [ ] Divide larger images into 128x128 tiles when converting.
- [ ] Experiment with tile sizes, to see if it increases performance.
- [ ] Benchmark and profile some more.
png2svg-1.5.4/box.go 0000664 0000000 0000000 00000011660 14547552620 0014244 0 ustar 00root root 0000000 0000000 package png2svg
import (
"fmt"
"math/rand"
"strconv"
"github.com/xyproto/tinysvg"
)
// Box represents a box with the following properties:
// * position (x, y)
// * size (w, h)
// * color (r, g, b, a)
type Box struct {
x, y int
w, h int
r, g, b, a int
}
// CreateRandomBox randomly searches for a place for a 1x1 size box.
// Note: If checkIfPossible is true, the function continue running until
// it either finds a free spot or no spots are available.
func (pi *PixelImage) CreateRandomBox(checkIfPossible bool) *Box {
w := 1
h := 1
var x, y, r, g, b, a int
for !checkIfPossible || !pi.Done(0, 0) {
// Find a random placement for (x,y), for a box of size (1,1)
x = rand.Intn(pi.w)
y = rand.Intn(pi.h)
if pi.verbose {
fmt.Printf("Random box at (%d, %d)\n", x, y)
}
if pi.Covered(x, y) {
continue
}
r, g, b, a = pi.At2(x, y)
break
}
// Create a box at that placement, with width 1 and height 1
// Return the box
return &Box{x, y, w, h, r, g, b, a}
}
// CreateBox creates a 1x1 box at the given location, if it's not already covered
func (pi *PixelImage) CreateBox(x, y int) *Box {
if pi.Covered(x, y) {
panic("CreateBox at location that was already covered")
}
w, h := 1, 1
r, g, b, a := pi.At2(x, y)
// Create a box at that placement, with width 1 and height 1
// Return the box
return &Box{x, y, w, h, r, g, b, a}
}
// ExpandLeft will expand a box 1 pixel to the left,
// if all new pixels have the same color
func (pi *PixelImage) ExpandLeft(bo *Box) bool {
// Loop from box top left (-1,0) to box bot left (-1,0)
x := bo.x - 1
if x <= 0 {
return false
}
for y := bo.y; y < (bo.y + bo.h); y++ {
r, g, b, a := pi.At2(x, y)
if (r != bo.r) || (g != bo.g) || (b != bo.b) || (a != bo.a) {
return false
}
}
// Expand the box 1 pixel to the left
bo.w++
bo.x--
return true
}
// ExpandUp will expand a box 1 pixel upwards,
// if all new pixels have the same color
func (pi *PixelImage) ExpandUp(bo *Box) bool {
// Loop from box top left to box top right
y := bo.y - 1
if y <= 0 {
return false
}
for x := bo.x; x < (bo.x + bo.w); x++ {
r, g, b, a := pi.At2(x, y)
if (r != bo.r) || (g != bo.g) || (b != bo.b) || (a != bo.a) {
return false
}
}
// Expand the box 1 pixel up
bo.h++
bo.y--
return true
}
// ExpandRight will expand a box 1 pixel to the right,
// if all new pixels have the same color
func (pi *PixelImage) ExpandRight(bo *Box) bool {
// Loop from box top right (+1,0) to box bot right (+1,0)
x := bo.x + bo.w //+ 1
if x >= pi.w {
return false
}
for y := bo.y; y < (bo.y + bo.h); y++ {
r, g, b, a := pi.At2(x, y)
if (r != bo.r) || (g != bo.g) || (b != bo.b) || (a != bo.a) {
return false
}
}
// Expand the box 1 pixel to the right
bo.w++
return true
}
// ExpandDown will expand a box 1 pixel downwards,
// if all new pixels have the same color
func (pi *PixelImage) ExpandDown(bo *Box) bool {
// Loop from box bot left to box bot right
y := bo.y + bo.h //+ 1
if y >= pi.h {
return false
}
for x := bo.x; x < (bo.x + bo.w); x++ {
r, g, b, a := pi.At2(x, y)
if (r != bo.r) || (g != bo.g) || (b != bo.b) || (a != bo.a) {
return false
}
}
// Expand the box 1 pixel down
bo.h++
return true
}
// ExpandOnce tries to expand the box to the right and downwards, once
func (pi *PixelImage) ExpandOnce(bo *Box) bool {
if pi.ExpandRight(bo) {
return true
}
return pi.ExpandDown(bo)
}
// Expand tries to expand the box to the right and downwards, until it can't expand any more.
// Returns true if the box was expanded at least once.
func (pi *PixelImage) Expand(bo *Box) (expanded bool) {
for {
if !pi.ExpandOnce(bo) {
break
}
expanded = true
}
return
}
// singleHex returns a single digit hex number, as a string
// the numbers are not rounded, just floored
func singleHex(x int) string {
hex := strconv.FormatInt(int64(x), 16)
if len(hex) == 1 {
return "0"
}
return string(hex[0])
}
// shortColorString returns a string representing a color on the short form "#000"
func shortColorString(r, g, b int) string {
return "#" + singleHex(r) + singleHex(g) + singleHex(b)
}
// CoverBox creates rectangles in the SVG image, and also marks the pixels as covered
// if pink is true, the rectangles will be pink
// if optimizeColors is true, the color strings will be shortened (and quantized)
func (pi *PixelImage) CoverBox(bo *Box, pink bool, optimizeColors bool) {
// Draw the rectangle
rect := pi.svgTag.AddRect(bo.x, bo.y, bo.w, bo.h)
// Generate a fill color string
var colorString string
if pink {
if optimizeColors {
colorString = "#b38"
} else {
colorString = "#bb3388"
}
} else if optimizeColors {
colorString = shortColorString(bo.r, bo.g, bo.b)
} else {
colorString = string(tinysvg.ColorBytes(bo.r, bo.g, bo.b))
}
// Set the fill color
rect.Fill(colorString)
// Mark all covered pixels in the PixelImage
for y := bo.y; y < (bo.y + bo.h); y++ {
for x := bo.x; x < (bo.x + bo.w); x++ {
pi.pixels[y*pi.w+x].covered = true
}
}
}
png2svg-1.5.4/cmd/ 0000775 0000000 0000000 00000000000 14547552620 0013664 5 ustar 00root root 0000000 0000000 png2svg-1.5.4/cmd/png2svg/ 0000775 0000000 0000000 00000000000 14547552620 0015252 5 ustar 00root root 0000000 0000000 png2svg-1.5.4/cmd/png2svg/main.go 0000664 0000000 0000000 00000011644 14547552620 0016533 0 ustar 00root root 0000000 0000000 package main
import (
"errors"
"fmt"
"os"
"github.com/urfave/cli/v2"
"github.com/xyproto/palgen"
"github.com/xyproto/png2svg"
)
// Config contains the results of parsing the flags and arguments
type Config struct {
inputFilename string
outputFilename string
colorOptimize bool
colorPink bool
limit bool
quantize bool
singlePixelRectangles bool
verbose bool
version bool
palReduction int
}
func main() {
var config Config
app := &cli.App{
Name: "png2svg",
Usage: "Convert PNG images to SVG format",
Flags: []cli.Flag{
&cli.StringFlag{
Name: "o",
Value: "-",
Usage: "SVG output filename",
Destination: &config.outputFilename,
},
&cli.BoolFlag{
Name: "p",
Usage: "use only single pixel rectangles",
Destination: &config.singlePixelRectangles,
},
&cli.BoolFlag{
Name: "c",
Usage: "color expanded rectangles pink",
Destination: &config.colorPink,
},
&cli.BoolFlag{
Name: "v",
Usage: "verbose",
Destination: &config.verbose,
},
&cli.BoolFlag{
Name: "version, V",
Usage: "print the version",
Aliases: []string{"V"},
Destination: &config.version,
},
&cli.BoolFlag{
Name: "l",
Usage: "limit colors to a maximum of 4096 (#abcdef -> #ace)",
Destination: &config.limit,
},
&cli.BoolFlag{
Name: "q",
Usage: "deprecated (same as -l)",
Destination: &config.quantize,
},
&cli.BoolFlag{
Name: "z",
Usage: "deprecated (same as -l)",
Destination: &config.colorOptimize,
},
&cli.IntFlag{
Name: "n",
Value: 0,
Usage: "reduce the palette to N colors",
Destination: &config.palReduction,
},
},
Action: func(c *cli.Context) error {
if c.Bool("version") {
fmt.Println(png2svg.VersionString)
return nil
}
config.limit = config.limit || config.quantize || config.colorOptimize
if config.colorPink {
config.singlePixelRectangles = false
}
if c.Args().Len() == 0 {
return errors.New("an input PNG filename is required")
}
config.inputFilename = c.Args().First()
return Run(&config)
},
}
err := app.Run(os.Args)
if err != nil {
fmt.Fprintf(os.Stderr, "error: %s\n", err.Error())
os.Exit(1)
}
}
// Run performs the user-selected operations
func Run(c *Config) error {
var (
box *png2svg.Box
x, y int
expanded bool
lastx, lasty int
lastLine int // one message per line / y coordinate
done bool
)
img, err := png2svg.ReadPNG(c.inputFilename, c.verbose)
if err != nil {
return err
}
if c.palReduction > 0 {
img, err = palgen.Reduce(img, c.palReduction)
if err != nil {
return fmt.Errorf("could not reduce the palette of the given image to a maximum of %d colors", c.palReduction)
}
}
height := img.Bounds().Max.Y - img.Bounds().Min.Y
pi := png2svg.NewPixelImage(img, c.verbose)
pi.SetColorOptimize(c.limit)
percentage := 0
lastPercentage := 0
if !c.singlePixelRectangles {
if c.verbose {
fmt.Print("Placing rectangles... 0%")
}
// Cover pixels by creating expanding rectangles, as long as there are uncovered pixels
for !c.singlePixelRectangles && !done {
// Select the first uncovered pixel, searching from the given coordinate
x, y = pi.FirstUncovered(lastx, lasty)
if c.verbose && y != lastLine {
lastPercentage = percentage
percentage = int((float64(y) / float64(height)) * 100.0)
png2svg.Erase(len(fmt.Sprintf("%d%%", lastPercentage)))
fmt.Printf("%d%%", percentage)
lastLine = y
}
// Create a box at that location
box = pi.CreateBox(x, y)
// Expand the box to the right and downwards, until it can not expand anymore
expanded = pi.Expand(box)
// Use the expanded box. Color pink if it is > 1x1, and colorPink is true
pi.CoverBox(box, expanded && c.colorPink, c.limit)
// Check if we are done, searching from the current x,y
done = pi.Done(x, y)
}
if c.verbose {
png2svg.Erase(len(fmt.Sprintf("%d%%", lastPercentage)))
fmt.Println("100%")
}
}
if c.singlePixelRectangles {
// Cover all remaining pixels with rectangles of size 1x1
if c.verbose {
percentage = 0
lastPercentage = 0
fmt.Print("Placing 1x1 rectangles... 0%")
pi.CoverAllPixelsCallback(func(currentIndex, totalLength int) {
lastPercentage = percentage
percentage = int((float64(currentIndex) / float64(totalLength)) * 100.0)
png2svg.Erase(len(fmt.Sprintf("%d%%", lastPercentage)))
fmt.Printf("%d%%", percentage)
}, 1024) // update the status for every 1024 pixels (+ at the start and end)
png2svg.Erase(len(fmt.Sprintf("%d%%", lastPercentage)))
fmt.Println("100%")
} else {
pi.CoverAllPixels()
}
}
// Write the SVG image to outputFilename
return pi.WriteSVG(c.outputFilename)
}
png2svg-1.5.4/go.mod 0000664 0000000 0000000 00000001061 14547552620 0014225 0 ustar 00root root 0000000 0000000 module github.com/xyproto/png2svg
go 1.18
require (
github.com/urfave/cli/v2 v2.25.1
github.com/xyproto/palgen v1.5.0
github.com/xyproto/tinysvg v1.1.0
)
require (
github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect
github.com/lucasb-eyer/go-colorful v1.2.0 // indirect
github.com/peterhellberg/gfx v0.0.0-20230526095554-e6202e653d52 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect
github.com/xyproto/burnpal v0.0.0-20191014132200-bd9858647795 // indirect
)
png2svg-1.5.4/go.sum 0000664 0000000 0000000 00000003514 14547552620 0014257 0 ustar 00root root 0000000 0000000 github.com/cpuguy83/go-md2man/v2 v2.0.2 h1:p1EgwI/C7NhT0JmVkwCD2ZBK8j4aeHQX2pMHHBfMQ6w=
github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
github.com/lucasb-eyer/go-colorful v1.2.0 h1:1nnpGOrhyZZuNyfu1QjKiUICQ74+3FNCN69Aj6K7nkY=
github.com/lucasb-eyer/go-colorful v1.2.0/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0=
github.com/peterhellberg/gfx v0.0.0-20191011152831-b91a0de61948/go.mod h1:itlt/V2ABb7sDu42VXQHXmQ4KOdrEbFZDVIaHsRcwak=
github.com/peterhellberg/gfx v0.0.0-20230526095554-e6202e653d52 h1:8r7qtzchwpcnDfmP+8+Lpaqd5pJpoBLh28pdsUlLv5Y=
github.com/peterhellberg/gfx v0.0.0-20230526095554-e6202e653d52/go.mod h1:ipo3f7y1+RHNR32fj+4TETou6OF4VXvJBhb9rwncKuw=
github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk=
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/urfave/cli/v2 v2.25.1 h1:zw8dSP7ghX0Gmm8vugrs6q9Ku0wzweqPyshy+syu9Gw=
github.com/urfave/cli/v2 v2.25.1/go.mod h1:GHupkWPMM0M/sj1a2b4wUrWBPzazNrIjouW6fmdJLxc=
github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 h1:bAn7/zixMGCfxrRTfdpNzjtPYqr8smhKouy9mxVdGPU=
github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673/go.mod h1:N3UwUGtsrSj3ccvlPHLoLsHnpR27oXr4ZE984MbSER8=
github.com/xyproto/burnpal v0.0.0-20191014132200-bd9858647795 h1:AoL5T5pFgiCn/4feC2ZfAE+7altlWK2KwBntHHAgDpE=
github.com/xyproto/burnpal v0.0.0-20191014132200-bd9858647795/go.mod h1:j3S/tDDOEkIChz0sWDqO3zXOgIjz/6nhuc+JrmZNLnA=
github.com/xyproto/palgen v1.5.0 h1:JIU39lMxk2Nad1V5hrCUmH8b15R9EdwNTsAzkiII0vU=
github.com/xyproto/palgen v1.5.0/go.mod h1:IN7HA45EecW7BTEzkJzaSZljyQdjzNp5kdUQ4gpu0T8=
github.com/xyproto/tinysvg v1.1.0 h1:g8NBSGR90npPhNnbmEIPbkxHdyiFXSQrm5mVVoFFRNA=
github.com/xyproto/tinysvg v1.1.0/go.mod h1:DKgmaYuFIvJab9ug4nH4ZG356VtUaKXG2mUU07GIurs=
png2svg-1.5.4/images.sh 0000775 0000000 0000000 00000001063 14547552620 0014725 0 ustar 00root root 0000000 0000000 #!/bin/sh
(cd cmd/png2svg; go build -mod=vendor -v)
for x in 128 96 64 32 16 8 6 4 2; do
cmd/png2svg/png2svg -n ${x} -v -l -o img/rainforest_${x}c.svg img/rainforest.png
echo svgo
svgo --multipass img/rainforest_${x}c.svg -o img/rainforest_${x}c_opt.svg
done
cmd/png2svg/png2svg -v -l -o img/rainforest4096.svg img/rainforest.png
echo svgo
svgo --multipass img/rainforest4096.svg -o img/rainforest_opt.svg
cmd/png2svg/png2svg -v -l -o img/spaceships4096.svg img/spaceships.png
echo svgo
svgo --multipass img/spaceships4096.svg -o img/spaceships_opt.svg
png2svg-1.5.4/img/ 0000775 0000000 0000000 00000000000 14547552620 0013675 5 ustar 00root root 0000000 0000000 png2svg-1.5.4/img/glenda.png 0000664 0000000 0000000 00000004337 14547552620 0015644 0 ustar 00root root 0000000 0000000 PNG
IHDR @ @ . gAMA a cHRM z&