https://github.com/abzico/colorrectdump
A tool to find rectangular area for color pixels that live in the input .png image
https://github.com/abzico/colorrectdump
c cli image-processing images png
Last synced: over 1 year ago
JSON representation
A tool to find rectangular area for color pixels that live in the input .png image
- Host: GitHub
- URL: https://github.com/abzico/colorrectdump
- Owner: abzico
- License: mit
- Created: 2019-05-10T10:42:24.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2019-05-11T11:25:11.000Z (about 7 years ago)
- Last Synced: 2025-01-23T11:34:46.042Z (over 1 year ago)
- Topics: c, cli, image-processing, images, png
- Language: C
- Size: 42 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# colorrectdump
A tool to find rectangular area for color pixels that live in the input .png image.
# Build
Depends on [libpng](http://www.libpng.org/pub/png/libpng.html), so install it first.
* `./autogen.sh`
* `./configure`
* `make -j4`
* `sudo make install`
# Usage
`colorrectdump input-image-filepath|--help|--version`
Example:
`colorrectdump /path/to/my/image.png`
it will print out result with 4 numbers onto starndard output in format `x-min y-min x-max y-max` in which `x-min` and `y-min` are the top left corner of the rectangular area. You can further use batch/bash script to do batch process from this output on top.
Example output:
`114 144 269 227`
this means
* `x-min` is 114
* `y-min` is 144
* `x-max` is 269
* `y-max` is 227
you can further calculate width/height from `x-max`-`x-min`, and `y-max`-`y-min` respectively.
# NOTE
Currently it works only with RGBA .png file format that has transparent pixels. If you input opaque image like grayscale, or RGB format, the output is not defined as well as its behavior. This feature will be considered to add later.
# LICENSE
[MIT](https://github.com/abzico/colorrectdump/blob/master/LICENSE), [Angry Baozi](https://abzi.co)