Code Monkey home page Code Monkey logo

Comments (3)

Lokathor avatar Lokathor commented on August 26, 2024

If we support this group of formats sooner than later the library will be usable with the Ray Tracing In One Weekend series, which would be extremely convenient.

from imagine.

Lokathor avatar Lokathor commented on August 26, 2024

This is several related "formats" that all probably work with the same general parsing system:

  • P1: ascii, 1bpp (0=white, 1=black), .pbm
  • P2: ascii, variable bpp (grayscale/monochrome), .pgm
  • P3: ascii, variable bpp (RGB), .ppm
  • P4: as P1 but binary: 8 pixels packed per byte
  • P5: as P2 but binary: 8 or 16 bit per channel (BE)
  • P6: as P3 but binary: 8 or 16 bit per channel (BE)
  • PF: RGB image format using floats
  • Pf: similar to PF but grayscale
  • PF4: similar, but uses RGBA
  • P7: binary, variable bpp and channels according to header data, .pam

Note that the header data portion is always ascii text that describes the image, only the image data encoding is what's binary or not.

Since this is all largely intended as a basic intermediate format it's pretty simple stuff. The files end up being huge because they don't have any compression (the ascii versions are actually bigger than their "raw" form because most numbers take more bytes to write as ascii than their in-memory value), but then again you could put the file into a compressed archive instead of specifying that compression is inside the data stream, so maybe it's fine.

from imagine.

Lokathor avatar Lokathor commented on August 26, 2024

Closed by 751d125

from imagine.

Related Issues (20)

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.