1.1.0 • Published 4 years ago

nameco v1.1.0

Weekly downloads
3
License
MIT
Repository
github
Last release
4 years ago

Nameco.js
Node.js Package

Overview


A Javascript Library to embed text data into any image file. You can embed data with just few code (like below!) .

var Img= new Image();
Img.src="Example.png";

var Obj=new Nameco();
Obj.Text="foo";//Set your data as string.
Obj.Base=Img; //Nameco.js writes your data into this.

var DataUrl=Obj.Encode();
//You can get DataUrl of image that embeded your data.

Features


  • Embed your string data into image. : Nameco.Encode();
  • Decode your image that was encoded by Nameco.js.:Nameco.Decode();

VS.-- Why Nameco?


In the data-hiding subject, There are a lot of way to embed your data into image file. For example,steganography or QR code .But Nameco was born. Why? Because Nameco is good at some points like below.

  • Non limited data size
  • Infinity pattern writing paramater
  • Cross platform
  • 2ch data writing---You can embed two of your data to one image.

Requirement


Nameco needs just below only.

  • HTML5
  • JavaScript

Usage


Encode

You can encode like below. Please change each parameter to you needed.

var Img= new Image();
Img.src="Example.png";

var Obj=new Nameco();
Obj.Mode = 0;
Obj.Base=Img; //Nameco.js writes your data into this.
Obj.StrFlg = true;
Obj.Text="foo";//Set your data as string.

var DataUrl=Obj.Encode();
//You can get DataUrl of image that embeded your data.

Paramaters

NameValue typeDecsription
Modeinteger(0 to 3)Color chanel mode. Nameco writes .Text to selected chanel of .Base. Color chanel is 0: Red , 1: Green, 2:Blue,3:Alpha
Baseimage objectNameco writes .Text to this.
StrFlgtrue/falseTrue : Do UTF16 like encoding before embed. False: Don't do.
TextStringYour data as string. Nameco writes this to .Base
  • After running .Encode() method, DataURL is saved in .DataURL.

Decode

You can decode like below. Please change each parameter to you needed.

var Img= new Image();
Img.src="Embeded.png";

var Obj=new Nameco();
Obj.Mode = 0;
Obj.Img=Img; 
Obj.StrFlg = true;
var Text=Obj.Decode();//Text is gotten in here.

Paramaters

NameValue typeDecsription
Modeinteger(0 to 3)Color chanel mode. Nameco reads .Text from selected chanel of .Img. Color chanel is 0: Red , 1: Green, 2:Blue,3:Alpha
Imgimage objectNameco decodes data from this.
StrFlgtrue/falseTrue : Do UTF16 like decoding after decode. False: Don't do.
  • After running .Decode() method, Data(as Text) is saved in .Text.

Advanced

Paramater .ColorPlatet is a little difficult to use paramater,but very powerful one. Nameco repraces each character to color number. ColorPalet decides the color number of each character. So If you use this paramater well,you can encrypt your data.

You would like to use Nameco?


You have to do just 2 thing. 1st, please upload and include Nameco.js to HTML . 2nd,please write (c) 2017 Yusei Ito --Nameco.js in your application's credit .

Contribution


Please send me pull request.

Author-Yusei Ito


Licence

MIT. See LICENCE.

1.1.0

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago