Lodepng

PNG encoder and decoder in C and C++.
Alternatives To Lodepng
Project NameStarsDownloadsRepos Using ThisPackages Using ThisMost Recent CommitTotal ReleasesLatest ReleaseOpen IssuesLicenseLanguage
Blurhash13,29529616 days ago9September 12, 202246mitC
A very compact representation of a placeholder for an image.
Nmt6,085
5 months ago275apache-2.0Python
TensorFlow Neural Machine Translation Tutorial
Seq2seq5,300
2 years ago194apache-2.0Python
A general-purpose encoder-decoder framework for Tensorflow
Pytorch Seq2seq4,356
a day ago52mitJupyter Notebook
Tutorials on implementing a few sequence-to-sequence (seq2seq) models with PyTorch and TorchText.
Ultrajson4,0043,2789202 days ago33July 02, 202222otherC
Ultra fast JSON decoder and encoder written in C with Python bindings
Flif3,682
a year ago1March 20, 2019137otherC++
Free Lossless Image Format
Seq2seq3,118
7 months ago105gpl-2.0Python
Sequence to Sequence Learning with Keras
He2,719373,3161,1442 years ago27September 23, 201817mitJavaScript
A robust HTML entity encoder/decoder written in JavaScript.
Ffjson2,6202423563 years ago2February 06, 201557apache-2.0Go
faster JSON serialization for Go
Semantic Segmentation Suite2,311
2 years ago83Python
Semantic Segmentation Suite in TensorFlow. Implement, train, and test new Semantic Segmentation models easily!
Alternatives To Lodepng
Select To Compare


Alternative Project Comparisons
Readme

LodePNG

PNG encoder and decoder in C and C++, without dependencies

Home page: http://lodev.org/lodepng/

Documentation

Detailed documentation is included in a large comment in the second half of the header file lodepng.h.

Source code examples using LodePNG can be found in the examples directory.

An FAQ can be found on http://lodev.org/lodepng/

Building

Only two files are needed to encode and decode PNGs:

  • lodepng.cpp (or renamed to lodepng.c)
  • lodepng.h

All other files are just source code examples, tests, misc utilities, etc..., which are normally not needed in projects using this.

You can include the files directly in your project's source tree and its makefile, IDE project file, or other build system. No library is necessary.

In addition to C++, LodePNG also supports ANSI C (C89), with all the same functionality: C++ only adds extra convenience API.

For C, rename lodepng.cpp to lodepng.c.

Consider using git submodules to include LodePNG in your project.

Compiling in C++

If you have a hypothetical your_program.cpp that #includes and uses lodepng.h, you can build as follows:

g++ your_program.cpp lodepng.cpp -Wall -Wextra -pedantic -ansi -O3

or:

clang++ your_program.cpp lodepng.cpp -Wall -Wextra -pedantic -ansi -O3

This shows compiler flags it was designed for, but normally one would use the compiler or build system of their project instead of those commands, and other C++ compilers are supported.

Compiling in C

Rename lodepng.cpp to lodepng.c for this.

If you have a hypothetical your_program.c that #includes and uses lodepng.h, you can build as follows:

gcc your_program.c lodepng.c -ansi -pedantic -Wall -Wextra -O3

or

clang your_program.c lodepng.c -ansi -pedantic -Wall -Wextra -O3

This shows compiler flags it was designed for, but normally one would use the compiler or build system of their project instead of those commands, and other C compilers are supported.

Makefile

There is a Makefile, but this is not intended for using LodePNG itself since the way to use that one is to include its source files in your program. The Makefile only builds development and testing utilities. It can be used as follows:

make -j

Popular Decoder Projects
Popular Encoder Projects
Popular Media Categories

Get A Weekly Email With Trending Projects For These Categories
No Spam. Unsubscribe easily at any time.
C Plus Plus
Makefile
Decoder
Encoder