ascii-generator

command module
v0.0.0-...-4dacea9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 29, 2023 License: GPL-3.0 Imports: 13 Imported by: 0

README

ASCII API

Generate ASCII art from image.

You can try this API here: ascii-generator.herokuapp.com

Deploy

Installation

Prerequisites

git clone https://github.com/shaynlink/ascii-api.git

cd ascii-api

go run *.go

I recommend to use Postman. for try API in local

Run in Postman

Enpoints

Method Path Description
POST / Generate ASCII art from image.
* * Generate ASCII art from image.

Parameters

(POST) /

Parameters form-data

  • image: Image file.
  • width: Width of the generated ASCII art.
  • invert: Invert the image.

Return text ACII art.

Example code client

Curl
curl --location --request POST 'http://ascii.projects.shaynlink.dev' \
--form 'image=@"./test.png"' \
--form 'width="80"' \
--form 'invert="true"'
NodeJS (axios)
const axios = require('axios');
const FormData = require('form-data');
const fs = require('fs');

const data = new FormData();

data.append('image', fs.createReadStream('./test.png'));
data.append('width', 80);
data.append('invert', true);

axios({
  method: 'post',
  url: 'http://ascii.projects.shaynlink.dev',
  headers: data.getHeaders()
  data
})
    .then(({data}) => {
        console.log(data);
    });

Credits

All of the contributors that have helped with implementing various features, adding themes, fixing bugs, and more.

Support

Thanks you for support my project and me, using ascii-generator.

You can also support me by donate, patron or buy me a coffee.

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL