All Projects → brackeen → ok-file-formats

brackeen / ok-file-formats

Licence: MIT license
Decoders for PNG, JPEG, WAV, and a few other file formats

Programming Languages

c
50402 projects - #5 most used programming language
CMake
9771 projects
objective c
16641 projects - #2 most used programming language

Projects that are alternatives of or similar to ok-file-formats

wordpress-plugin
Speed up your WordPress website. Optimize your JPEG and PNG images automatically with TinyPNG.
Stars: ✭ 78 (+8.33%)
Mutual labels:  jpg, png
3dn-bip
A Python library for Blender addons. Blazingly fast preview loads in Blender. Images of arbitrary size. bpy.utils.previews drop-in replacement.
Stars: ✭ 41 (-43.06%)
Mutual labels:  jpg, png
HEIF
Mac OS X: Convert any image to HEIF/HEIC format
Stars: ✭ 58 (-19.44%)
Mutual labels:  jpg, png
Gimage
A PHP library for easy image handling. 🖼
Stars: ✭ 148 (+105.56%)
Mutual labels:  jpg, png
autosvg
Autosvg is tracing tool, which can convert image format like (jpg,png,gif) into vector
Stars: ✭ 35 (-51.39%)
Mutual labels:  jpg, png
Ccapture.js
A library to capture canvas-based animations at a fixed framerate
Stars: ✭ 2,836 (+3838.89%)
Mutual labels:  jpg, png
oculante
A minimalistic crossplatform image viewer written in rust
Stars: ✭ 169 (+134.72%)
Mutual labels:  jpg, png
Quickshot
Capture images of any View, SurfaceView or Bitmap from your Android app in: .jpg .png or .nomedia with simple oneliner codes.
Stars: ✭ 663 (+820.83%)
Mutual labels:  jpg, png
ee.Screen
Takes screenshots of web pages for the list of URLs. Various resolutions, multiple formats (JPG, PDF, PNG and TXT)
Stars: ✭ 19 (-73.61%)
Mutual labels:  jpg, png
saveddit
Bulk Downloader for Reddit
Stars: ✭ 130 (+80.56%)
Mutual labels:  jpg, png
Imageviewer
HDR, PFM, DDS, KTX, EXR, PNG, JPG, BMP image viewer and manipulator
Stars: ✭ 71 (-1.39%)
Mutual labels:  jpg, png
image-optimizer
Image optimization using PHP
Stars: ✭ 28 (-61.11%)
Mutual labels:  jpg, png
Optimise Images
Batch image resizer, optimiser and profiler using ImageMagick convert, OptiPNG, JpegOptim and optional ZopfliPNG, Guetzli and MozJPEG.
Stars: ✭ 64 (-11.11%)
Mutual labels:  jpg, png
StegX
Steganography (BMP, PNG, WAV, MP3, AVI, FLV)
Stars: ✭ 22 (-69.44%)
Mutual labels:  png, wav
Image Optimizer
Image optimization / compression library. This library is able to optimize png, jpg and gif files in very easy and handy way. It uses optipng, pngquant, pngcrush, pngout, gifsicle, jpegoptim and jpegtran tools.
Stars: ✭ 785 (+990.28%)
Mutual labels:  jpg, png
save-html-as-image
Download the HTML (DOM) to Image (JPG, PNG)
Stars: ✭ 26 (-63.89%)
Mutual labels:  jpg, png
Exifr
📷 The fastest and most versatile JS EXIF reading library.
Stars: ✭ 448 (+522.22%)
Mutual labels:  jpg, png
Imagemin
[Unmaintained] Minify images seamlessly
Stars: ✭ 4,948 (+6772.22%)
Mutual labels:  jpg, png
dom-to-image-more
Generates an image from a DOM node using HTML5 canvas
Stars: ✭ 231 (+220.83%)
Mutual labels:  jpg, png
tinypng-free
Use the upload api of tinypng's homeage to compress images
Stars: ✭ 29 (-59.72%)
Mutual labels:  jpg, png

ok-file-formats

C functions for reading a few different file formats. No external dependencies. Written in C99.

Library Description
ok_png Reads PNG files. Supports Apple's proprietary CgBI chunk. Tested against the PngSuite.
ok_jpg Reads JPEG files. Baseline and progressive formats. Interprets EXIF orientation tags. No CMYK support.
ok_wav Reads WAV and CAF files. PCM, u-law, a-law, and ADPCM formats.
ok_fnt Reads AngelCode BMFont files. Binary format from AngelCode Bitmap Font Generator v1.10 or newer.
ok_csv Reads Comma-Separated Values files.
ok_mo Reads gettext MO files.

The source files do not depend on one another. If all you need is to read a PNG file, just use ok_png.h and ok_png.c.

The CMakeLists.txt file can be used but is not required.

The ok_png, ok_jpg, and ok_wav functions include:

  • Option to use a custom allocator (ok_png_read_with_allocator, etc.)
  • Fuzz tests.

The ok_png and ok_jpg functions include these decode options:

  • Get the image dimensions without decoding image data.
  • Premultiply alpha.
  • Flip the image vertically.

Example: Decode PNG

#include <stdio.h>
#include "ok_png.h"

int main() {
    FILE *file = fopen("my_image.png", "rb");
    ok_png image = ok_png_read(file, OK_PNG_COLOR_FORMAT_RGBA | OK_PNG_PREMULTIPLIED_ALPHA | OK_PNG_FLIP_Y);
    fclose(file);
    if (image.data) {
        printf("Got image! Size: %li x %li\n", (long)image.width, (long)image.height);
        free(image.data);
    }
    return 0;
}

Recent breaking changes in ok_png, ok_jpg, and ok_wav:

  • The read functions now return the ok_png, ok_jpg, and ok_wav structs on the stack instead of the heap. (These structs are small, around 24-32 bytes).
  • Replaced ok_png_read_to_buffer with ok_png_read_with_allocator.
  • Replaced ok_png_read_from_callbacks with ok_png_read_from_input.
  • Replaced error_message with error_code.
  • Removed ok_png_free. Free png.data directly instead.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].