File to image utility
Right now (version 0.1.0) you can only converts text to image and back again, but application contains the very simple algorithm that allows encoding files in the future. I want to realize the system like "Path to Image", what about store and share your projects in images? Sounds interesting. Ok go...
Do installation only global
yarn global add f2i
Run f2i
in the terminal and use UI application. Cli version right now in progress.
Recommended to use f2i.core package
You can import library to create your own projects. Just import f2i.core
import F2I from "f2i.core";
(You should install it manually with yarn add f2i.core
)
F2I.textToImage( text ).then( image => image.write( path ));
- Param
text
- this is the text to encode - Param
path
- this is the path where image will be saved
F2I.imagePathToText( path ).then(text => console.log(text));
- Param
path
- this is the path to yourpng
image file
This function returns the Promis<string>
.
UI Screen
- Save image - Saves image as file (with your text)
- Load image - Loads image and decode the text from it
(PS: Image seems not good in the application, it's cuz of the small size of the image)