+
Skip to content
This repository was archived by the owner on Feb 28, 2024. It is now read-only.

atgumx/imgg

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

imgg - cover images generator

Description

I needed a simple tool to generate dummy images for my blog's header and metadata, so I wrote one. imgg simply glues SVG <rect> blocks with different colors based on md5sum of an input text.

Usage & example

Running ./imgg without arguments produces a 320x320 svg image using the value of $RANDOM as the input text. The output is printed to the standard output.

To specify an output file use the option -o FILE or --output-file FILE. For example; running ./imgg -o examples/random.svg produces the following image:

random image

To add a label to the image use the option -l "label", for example ./imgg -l "hello" -o examples/hello.svg produces:

hello

Other available options are

Options:
  -h, --help                        display this help text and exit
  -v, --version                     print version and exit
  -s, --image-size WIDTH[,HEIGHT]   define ouput image width and height
  -p, --pixel-size WIDTH[,HEIGHT]   define squares width and height
  -f, --font-size SIZE              define label font size
  -i, --input-text TEXT             generate image based on TEXT hash
  -l, --label TEXT                  write TEXT on image
  -o, --output-file FILE            output to FILE instead of stdout

Defaults:
  Image width:  320
  Image height: equal to image width
  Pixel width:  40
  Pixel height: equal to image width
  Font size:    24 (in px)
  Label:        none
  Text:         same as label, or random if not defined

TODO

  • Generate images based on imput text
  • Detect and correct sizes errors
  • Detect and correct lable line length
  • Add multiline option
  • Write more test inputs to detect edge cases
  • Write proper documentation

Credits

License

This project is licensed under The Unlicense

About

Cover images generator

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载