Giter Site home page Giter Site logo

in4111 / text-image-encoder-decoder Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 21 KB

You can encode a Text(.txt) File To an Image( .png/ .jpg/....) with the pixel's color code using Encoder Module ,and vise versa using Decoder Module Provided in this Repository.

Python 100.00%

text-image-encoder-decoder's Introduction

Image---Text-Encoder-and-Decoder

Demo Image

Demo

Install Required Packages:

Use pip install -r requirements.txt to install required packages.

1)Importing Modules:

Use import to import modules (Encoder and Decoder) on the following way:

import Encoder as ec
import Decoder as dc

2)Encode a text File(.txt) to an image(.png/.jpg/....) by the form of:

Ec=ec.Encode("SampleIn.txt","ImageOut.png",n,(z1,z2,z3),(o1,o2,o3))
Ec.encode()
#SampleIn.txt:text to be encoded
#ImageOut.png:Destination of the image with encoded values
#n: bits for a value(example: x=8,represents a word lenght of 8 bits)
#(z1,z2,z3):color that needs to be represented in the pixel for zeros(note: values is in BGR)
#(o1,o2,o3):color that needs to be represented in the pixel for ones(note: values is in BGR)

3)Decode an image(.png/.jpg/....) to a text File(.txt) by the form of:

Dc=dc.Decode("ImageOut.png","SampleOut.txt",n,(z1,z2,z3),(o1,o2,o3))
Dc.decode()
#ImageOut.png:File(.png) that is Encoded by the Encoder(refer point-2)
#SampleOut.txt:destination of the Decoded text to a text file(.txt)
#(z1,z2,z3):values that needs to be represented in the pixel for zeros(note: values is in RGB)
#(o1,o2,o3):values that needs to be represented in the pixel for ones(note: values is in RGB)

text-image-encoder-decoder's People

Contributors

in4111 avatar

Stargazers

 avatar

Watchers

 avatar

text-image-encoder-decoder's Issues

illegala

bro doing illegal stuffs ๐Ÿ’€

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.