This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

Image operation utility

Installation

Installation using pip

$ pip install imgutil

Prerequesite

  • jpegtran
  • pngcrush

Command line utilities

imgoptimize

$ imgoptimize [-h] [-o OUTPUT] src_img
  • Optimize image to reduce file size.
  • Should install jpegtran and pngcrush.

Usage

  • -o: (Optional) Specifiy the output image.
  • src_img: Specify the input image.

imgresize

$ imgresize [-h] [-o OUTPUT] [-W WIDTH] [-H HEIGHT] src_img
  • Resize image by specifying width or height.

Usage

  • -o: (Optional) Specifiy the output image.
  • -W or --width: (Optional) Specify the desired image width. If only width is specified, height will be determined by the aspect ratio of image.
  • -H or --height: (Optional) Specify the desired image height. If only height is specified, width will be determined by the aspect ratio of image.
  • src_img: Specify the input image.

Usage

imgoptimize

imgoptimize(input_filename, output_filename=None)
  • Should install jpegtran and pngcrush.
  • It reduces jpeg/png file size.
  • It converts CMYK to RGB.

quick example

import os
from imgutil import imgoptimize

test_img = '/tmp/test.jpg'
os.stat(test_img).st_size              # 81073
imgoptimize(test_img, '/tmp/opt.jpg')  # output to /tmp/opt.jpg
os.stat('/tmp/opt.jpg').st_size        # 81026
imgoptimize(test_img)                  # optimize the original file
os.stat(test_img).st_size              # 81026

imgresize

imgresize(input_filename, width=None, height=None, output_filename=None)
  • It can resize image and preserve aspect ratio.
  • It can resize image to specified dimension.

quick example

from imgutil import imgresize

test_img = '/tmp/test.jpg'    # It is a 1024x768 image
imgresize(test_img, width=600, output_filename='/tmp/resize.jpg') # /tmp/resize.jpg is 600x450
imgresize(test_img, height=600, output_filename='/tmp/resize.jpg') # /tmp/resize.jpg is 800x600
imgresize(test_img, width=100, height=100, output_filename='/tmp/resize.jpg') # /tmp/resize.jpg is 100x100
imgresize(test_img, width=200, height=400) # /tmp/test.jpg is 200x400 now
Release History

Release History

0.1.4

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1.3

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1.2

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1.0

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
imgutil-0.1.4.tar.gz (4.5 kB) Copy SHA256 Checksum SHA256 Source Jun 8, 2016

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting