Giter Site home page Giter Site logo

pngcpp's Introduction

pngcpp

Toy project to experiment with PNG file format

This is a C++ implementation of the Blog entry by David Buchanan.

His writeup was well done and I wanted to not only understand it, but test my ability in C++. It's not the cleanest code and there are no doubt many bugs and/or issues that should be done better. I'm still learning C++ so this is really just a proof of concept.

Usage

Developed in Debian via WSL so building on different platforms could be an issue. Just close the repository and ensure you have zlib and run make.

Start with an image file in rgb format. You can use ImageMagick to convert and existing image:

$ convert ./samples/hello_png_original.png ./samples/hello_png.rgb

Then supply the rgb file to the app along with the output filename, width, and height. It will then convert it to a png file:

$ ./pngcpp hello_png.rgb new_file.png 320 180

Issues

  • Currently not checking platform for big or little endian, so it may not work on some systems.
  • Segfaults when width and height are set to incorrect sizes sometimes. This is most likely due to how memory is allocated. Since it compresses the file, it allocates space equal to the original input file and if you specify an output size that exceeds that, it breaks. I may get around to fixing that eventually.

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.