Skip to main content

psdtojpg

Version 0.1.0

Convert one or more PSD files to JPG format. Thumbnail and optimize them, or don’t.

I keep many of the assets I use for web development in PSD format. This lets me perform non-destructive edits and crops in Photoshop and come back to edit the originals later. I built psdtojpg to make it easier to generate, downsize, and optimize JPGs from my asset PSDs.

Installation

This is a Python 3 script, so use pip3 to install:

pip3 install psdtojpg

After this, run psdtojpg --help from your terminal to verify it’s installed properly.

Usage

Basic Conversion

psdtojpg my_file.psd
  • my_file.psd ➔ Converted/Original/my_file.jpg (original size, default quality: 80)

Downsizing Images

psdtojpg -w 640 -t 480 my_file.psd
  • my_file.psd ➔ Converted/Original/my_file.jpg (original size)

  • my_file.psd ➔ Converted/Resized/my_file.jpg (max size: 640x480 px)


psdtojpg -w 640 -t 480 -n my_file.psd
  • my_file.psd ➔ Converted/Resized/my_file.jpg (max size: 640x480 px)

Quality and Optimization

psdtojpg -q 60 my_file.psd
  • my_file.psd ➔ Converted/Original/my_file.jpg (original size, quality: 60)


psdtojpg -o my_file.psd
  • my_file.psd ➔ Converted/Original/my_file.jpg (original size, optimized with ImageOptim)

Custom Output Folders

psdtojpg -w 800 -t 600 -g orig -r thumb/sm my_file.psd
  • my_file.psd ➔ orig/my_file.jpg (original size)

  • my_file.psd ➔ thumb/sm/my_file.jpg (max size: 800x600 px)

Requirements

Python 3. (Tested with Python 3.4.1 on Mac OS X 10.9.3.)

Relies on the following packages:

Optional dependencies:

  • For image optimization on OS X: ImageOptim CLI—install with npm install -g imageoptim-cli

Help

Command: psdtojpg --help

usage: psdtojpg [-h] [-w MAX_WIDTH] [-t MAX_HEIGHT] [-q QUALITY] [-o] [-n]
                [-g ORIGINAL_FOLDER] [-r RESIZED_FOLDER]
                psd_file [psd_file ...]

Convert PSD files to JPG images.

positional arguments:
  psd_file              One or more PSD files to be converted

optional arguments:
  -h, --help            show this help message and exit
  -w MAX_WIDTH, --max-width MAX_WIDTH
                        The maximum width of resized output files in pixels.
  -t MAX_HEIGHT, --max-height MAX_HEIGHT
                        The maximum height of resized output files in pixels.
  -q QUALITY, --quality QUALITY
                        The output quality of JPG files. Default is 80.
  -o, --optimize        Optimize output files with ImageOptim after
                        conversion. Requires the imageOptim CLI to be
                        installed.
  -n, --no-originals    Do not output original-size JPGs.
  -g ORIGINAL_FOLDER, --original-folder ORIGINAL_FOLDER
                        The name of the output folder for original-size JPGs.
                        Can be nested.
  -r RESIZED_FOLDER, --resized-folder RESIZED_FOLDER
                        The name of the output folder for resized JPGs. Can be
                        nested.

Contributions

Bug reports, fixes, or features? Feel free to open an issue or pull request any time. You can also tweet me at mplewis or email me at matt@mplewis.com.

License

Copyright (c) 2014 Matthew Lewis. Licensed under the MIT License.

Release files for psdtojpg 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for psdtojpg 0.1.0
File Size Uploaded
psdtojpg-0.1.0.tar.gz 4.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for psdtojpg 0.1.0
File Interpreter ABI Platform
psdtojpg-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 11.8 kB

Release files / psdtojpg-0.1.0.tar.gz

Download URL psdtojpg-0.1.0.tar.gz
Size 4.7 kB
Tags Source
SHA-256 checksum
How to use checksums
56b301e85938c3960d6d4fb8693f5a6674f28a90a16f60d221636f2d9f8a2dcb
BLAKE2b-256 checksum
How to use checksums
7fb5630ec1411afaa125296749df7bd2fc95eaeb798ceeacc00eafbdbf9bf1c9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / psdtojpg-0.1.0-py3-none-any.whl

Download URL psdtojpg-0.1.0-py3-none-any.whl
Size 7.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7dcc5b54b02e78082cb7027e515d774707de199dd6fabcbb9ef32eaef0379d1a
BLAKE2b-256 checksum
How to use checksums
f431eabab5fb26114576cc2faf7186a82d146584a19ceb3b5f3b521a4ef0e3b9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page