Currently supported are gif and bmp.
This program is just a proof of concept example. It may contain bugs and it is only tested with valid inputs. Do NOT pass untrusted data to this program.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
To build this tool,
cmake are required (this is for Debian and Ubuntu based systems, for any other system please refer to its documentation).
After installing the dependencies, run the following commands:
$ git clone https://github.com/jklmnn/imagejs.git $ cd imagejs $ mkdir build $ cd build $ cmake .. $ make
imagejs option jsfile.js.
The outcoming image file will be named like the input file + the image ending..
Options are currently
If you add
-l as flag you your image is written to the file so that you can open it and view your code as a line of pixels.
This is currently only supported for bmp files.
$ ./imagejs bmp code.js -l
will return a file named code.js.bmp that is viewable.
Code can now be embedded into existing gif files by using the flag
-i with a gif file as argument.
$ ./imagejs gif code.js -i giffile.gif
This is currently available for gif, bmp, webp, where webp is still beta.
Supported output files are: