Skip to content

Latest commit

 

History

History
50 lines (31 loc) · 1.86 KB

README.md

File metadata and controls

50 lines (31 loc) · 1.86 KB

Web assembly image converter

CLICK TO USE!

example

This repo contains a simple image converter (PNG ↔ JPG) using WASM technology and C++ code.

Features:

  • client-side multiplattfom C++ logic execution in browser (x86/ARM, Windows/MacOS/Linux)
  • extensible to other (exotic) formats like PNM or TIFF, see here (section "Supported Image Formats)

Technologies & Tools

  • Web assembly
  • Bootstrap
  • Emscripten compiler (em++/emcc)
  • VS Code

Rationale

There are various image converters on the net which can be implemented one of the following way:

  • send the files to the server, where the conversion logic is implemented
  • JS client-side conversion via canvas drawing and export functionality, see Centipede5/imageconverter.

However this implementation serves as a technology test for a particular task.

How to build

CLI

  1. Install boost library
  2. Build shared libraries for boost::filesystem and boost::gil
  3. Run make build in the root directory. The executable is in build directory.

Web

  1. Install Emscripten SDK
  2. Activate emscripten for current terminal session (e.g. source ~/emsdk/emsdk_env.sh)
  3. In order to build libjpeg static library go to build/include and run emconfigure ./configure and emmake make.
  4. In the root folder: make wasm_page to build wasm artifact and corresponding .js code.
  5. Run an HTTP server in website/
  6. Enjoy!

License

MIT