GithubHelp home page GithubHelp logo

img2qr's Introduction

Img2QR


Overview

Img2QR is a command-line tool designed to convert image files into QR codes. This utility takes image files from the current directory, converts them into base64-encoded strings, and then encodes these base64 strings into QR codes. The resulting QR code images are saved in the same directory, providing a convenient way to encode and distribute image data via QR codes.

Features

  • Directory Scanning: Automatically scans the current directory for image files with extensions .jpg, .jpeg, and .png.
  • Base64 Encoding: Converts each image file into a base64-encoded string.
  • QR Code Generation: Encodes the base64 string into a QR code.
  • Customizable Output: Allows customization of QR code dimensions (width and height) and colors via command-line flags.
  • Batch Processing: Processes all supported image files in the specified directory.

Usage

To use the utility, compile the Go program and run the executable with the desired flags.

Compiling the Program
go build -o img2qr main.go
Running the Executable
./img2qr -width 512 -height 512 -color green
Command-Line Flags
  • -width: Specifies the width of the QR code (default: 256 pixels).
  • -height: Specifies the height of the QR code (default: 256 pixels).
  • -color: Specifies the color of the QR code. Options are black (default), green, red, and blue.

Example

./img2qr -width 512 -height 512 -color red

This command will scan the ./images directory for image files, convert each image to a base64 string, generate a QR code of size 512x512 pixels for each base64 string, with the QR code color set to red, and save the QR codes in the same directory.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.