Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jordic/image2json
commandline tool to generate a json file from a small image
https://github.com/jordic/image2json
Last synced: 2 days ago
JSON representation
commandline tool to generate a json file from a small image
- Host: GitHub
- URL: https://github.com/jordic/image2json
- Owner: jordic
- Created: 2014-06-17T16:33:40.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2014-06-17T16:55:45.000Z (over 10 years ago)
- Last Synced: 2024-11-06T02:56:55.602Z (about 2 months ago)
- Language: Go
- Size: 1.06 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# image2json
[email protected]
http://tempointeractiu.netimage2json, takes a small image, an converts it, to json string, representing, positions and their colors.
## Install
- Clone the repo
- go build image2json.go## Flags
``` image2json
-f="": Image file to decode
-nc=false: Output image without color info
-o="": file to output
```f: Input image
o: output file
nc: Output mode without colorsThe tool can ouput two diferent json strings, first with info color:
(without -nc flag)```js
{
"Width":93,
"Height":11,
"Bytes":[{"X":1,"Y":2,"C":{"R":91,"G":184,"B":255,"A":255}}, ... }
```Where Bytes holds and array of color positions, X,Y and their color balue in RGB. **White color on image rgb(0,0,0) is ommited**.
Second mode ( without color info ) flag -nc:
```js
{ "Width":13,
"Height":12,
"Bytes":[[2,0],[3,0],[4,0]... }
```Where byts only, outputs, position with color. For better results, this option must be used with single image colors. Also, **white** color is ommited
## For What I can use such tool
I builded it for deploying javascript "particle" animations, see examples folder.
```
*** ***
* * * *
* * *
* *
* *
* *
* *
* *
* *
* *
* *
*
```