tkanos / twx

Twx is a decentralised microblogging client based on the specs of [twtxt](https://dev.twtxt.net/), used to handle your twtxt file.
Other
2 stars 0 forks source link

timeline_show_ascii_images Show images on ascii #7

Closed tkanos closed 2 years ago

tkanos commented 2 years ago

timeline_show_ascii_images Show images on ascii

tkanos commented 2 years ago
package main

import (
    "fmt"
    _ "image/jpeg"
    _ "image/png"

    "github.com/qeesung/image2ascii/convert"
)

func main() {
    // Create convert options
    convertOptions := convert.DefaultOptions
    convertOptions.Colored = true
    convertOptions.Ratio = 1

    // Create the image converter
    converter := convert.NewImageConverter()
    fmt.Print(converter.ImageFile2ASCIIString("/tmp/twtxt_images/test.png", &convertOptions))
}