Skip to main content

Image Preview creation python library to create low footprint image previews, convenient to use as base64 data in your REST / GraphQL API payload.

Project description

[![Build Status](https://travis-ci.org/GaborWnuk/image-preview-python.svg?branch=master)](https://travis-ci.org/GaborWnuk/image-preview-python)

Simple helper module for Image Preview method for REST and GraphQL for immediate image preview on your client’s side (Swift, Java, JavaScript and so on).

Idea is to deliver only around 200 bytes of image data as a normal base64 data in one of JSON fields of your entities and then issue request to obtain full resolution of an image.

## Short “how does it work” The main reason to do such thing is to show your user approximate look of your data stream as soon as possible. This method gives you the ability to serve image previews in the sam milisecond you show your text content in your app, as image preview is delivered as one of data fields in your JSON response.

This library is sort of a helper to achieve above.

Because every thumbnail is compressed as JPEG, with the same size (default: 42x42 pixels) and using the same Huffman table, each JPEG file consist of a common header (620 bytes) and a small picture data part (around 200 bytes, depending on quality you use).

Having this in mind we choose to omit headers and send only 200 bytes (base64) and then prepend this data with a header on client side.

You can find basic Swift / iOS example here: [https://github.com/GaborWnuk/image-preview-ios-demo](https://github.com/GaborWnuk/image-preview-ios-demo).

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

imagepreview-0.0.1.tar.gz (2.9 kB view details)

Uploaded Source

File details

Details for the file imagepreview-0.0.1.tar.gz.

File metadata

  • Download URL: imagepreview-0.0.1.tar.gz
  • Upload date:
  • Size: 2.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for imagepreview-0.0.1.tar.gz
Algorithm Hash digest
SHA256 41c96b8abe61ae099152077c54b235ebc6ed18193fc191866f87b49a11d02fe4
MD5 d6d4d9395b00c64c07eeb360cd2d10ee
BLAKE2b-256 ca0826fc2baafb3ca1687f632b2ca5a616f92ecf429fa28f25a87131e5d77be0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page