digitalmsx
software

The following pieces of software are made freely available to the public for use as per their attached or associated licenses.

Photoshop CS1, CS2, CS3 - Resizer Lite

This is a Photoshop CS Javascript that allows you to automate the resizing and cropping of images in Photoshop without worrying about the orientation or aspect ratio (proportions) of the image. It will resize and crop an image to the exact dimensions that you specify. These features are especially useful when you want to automate the process on a number of images by adding it to an action set.

Note that many people have mentioned the "Fit Image" command which merely resizes an image to fit within a frame of a certain proportion, but does not actually crop an image to what you want as the final result.

You can find examples of how to use the script near the end of this page

Please provide any feedback via email to tech @ this-domain

Licensing

resizerlite.jsx is released under a liberal BSD-style license which enables you to add, modify, and distribute the code however you want, whether privately or commerically so long as the product retains the original copyright information and acknowledgements.

Downloadable Scripts

Right click on a link and "Save As" into a location where you can easily get to.

version 0.1.3a (14 Sept 2004 Photoshop CS).
version 0.1.4a (19 Nov 2004 Photoshop CS).
version 0.2.1a (30 April 2005 for Photoshop CS2).
version 0.2.2a (27 May 2007 for CS3, should be CS2 compatible).
LATEST version 0.3 (14 June 2010 for CS5, should be CS3 compatible).

Features

Instructions

I've attempted to make the script as simple to use as possible, so hopefully things should be obvious upfront. Nevertheless, this instruction set is meant to help you fine tune the script to your desired needs and also shows a few examples on the uses of the script.

You can edit the script with any text editor available on your system, such as Notepad. Simply open it up in the editor and change the required fields to meet your needs. Once you have finished editing the script, you should save it with an appropriate filename, such as "6x4x250_bordered.jsx" to indicate a script that resizes the photo to 6x4" at 250dpi and with a border.

To run the script in Photoshop, have an image opened and go to File->Scripts->Browse to locate your script. Photoshop will run it immediately after opening the script.

If you want the script to appear in Photoshops menu (in File->Scripts area) automatically, copy the script to the Photoshop/Presets/Scripts folder
(eg C:\Program Files\Adobe\Adobe Photoshop CS3\Presets\Scripts).

1.       Start by going to the section that has MODIFY THIS SECTION ONLY. Anything that is enclosed within /* and */ are comments and not processed by the scripting engine.

You can then modify any of the values that start with var, ie units, long_side, short_side, etc. The types of values you can change them to are shown after the example below.

/*
 * MODIFY THIS SECTION ONLY ***********************
 *
 * Change the following parameters to what you want.
 * Only change the values after the "=" sign.
 * ...
 */

var units       = INCHES;
var long_side   = 4;
var short_side  = 6;
var dpi         = 250;
var orientation = ORIG;
var border      = 0.25;
var dropshadow  = 0;
var textedge	= border/2;
var dateformat  = MDY;     // format for date timestamp

// leave color_profile as "" if no profile change desired.
var color_profile = "sRGB IEC61966-2.1"; 

2.       Go to the Personal Signature Overlay section. Changing this section allows you to add your own customised watermark onto the image. The watermark can be any type of image that Photoshop is able to open, ie, JPG, PNG, PSD, etc.

If you want your own logo as the watermark, I recommend that you create it as a two layer PSD, with the top layer being the logo. This way, you can have transparent areas around the logo not appear in the watermark.

/*
 * Personal Signature overlay
 *
 * - signature_file = specify the full filename of ...
 * ...
 */

var signature_file    = ""; // signature not used
var signature_position = BOTTOM_EDGE | RIGHT_CORNER;
var signature_width   = 1;
var signature_height  = 0;
var signature_opacity = 50.0;
var signature_gutter  = border + 0.1;

3.       The script allows you to add a large number of text fields to the image at many of the positions around the border. Each text field is specified as an element in the text_fields array. While it might look daunting to modify at first, once you understand what the entries are, you should be able to customise them yourself.

If you don't want to have any text added to the image, simply change the text_fields to:

var text_fields = "";

var text_fields = new Array (
        new Array(
                "TEXT",
                "FONT",
                FONT SIZE,
                PLACEMENT
        ),
        new Array(
                "\xA9 Copyright - text field 1",  // text
                "Arial",                          // font
                6,                                // size
                TOP_EDGE | LEFT_CORNER | TEXT_ALIGN_BORDER // align
        ),
        ...
    );

A text field consists of four entries and wrapped in an Array. The example in the script will draw text at almost every corner of the image. You can delete text field entry in the text_fields array if you don't want that many.

The entries in each text field consist of:

The script provides the flexibility of adding EXIF information to the text fields by looking for special character combinations that are prefixed with a %.

For example, if you wanted to have the filename shown and the date that the photo was taken, you can have a text string of
       "%f, shot on %D".
This will result in a line such as this being printed on the image:
       IMG_3444, shot on 30/03/2007

The full set of accepted fields that can be added to your custom text includes:

  %f - filename
  %F - filename with extension
  %d - date in YYYY/mm/dd format
  %D - date in dd/mm/YYYY (DMY) or mm/dd/YYYY (MDY) format
  %h - time in hh:mm AM/PM, 12 hour format
  %H - time in HH:MM, 24 hour format
  %i - ISO
  %a - aperture (f/stop)
  %s - speed (1/n seconds)
  %l - lens focal length (in mm)
  %b - camera Make
  %c - camera Model
  %% - print % character

4.       The final feature of the script is the ability to stamp a Proof text right in the center of the image. The proof text can be rotated counter-clockwise to any number of degrees. The opacity can also be changed if desired. The values should be straight forward to chanage if you want Proof stamping.

var proof_text = "";
var proof_font = "Arial";
var proof_text_size = 60;
var proof_text_rotate = 10;
var proof_text_opacity = 50.0;


Examples

I'm going to use the following photo as a starting point. It was taken with an SLR, so the proportions are 3:2 ratio, and it's 8 Megapixels in size.

Resize to 640x480 with a border

I change the script to have following parameters:

var units       = PIXELS;
var long_side   = 640;
var short_side  = 480;
var dpi         = 72;
var orientation = ORIG;
var border      = 30;
var dropshadow  = 0;
var textedge	= border/2;
var dateformat  = MDY;

var text_fields = "";

As you can see from the resulting image below, resizing the photo to 640x480 will crop it a little because the SLR photo is actually wider in proportion than 640x480. Since we specified both the long side and short side, the script will perform an automatic cropping of the photo to fit within the dimensions. It doesn't squish them down into proportions because the photo would end up looking distorted in one direction.

Add Watermark/Signature

I create the following logo to be used as a watermark. It's a two layer Photoshop image with an empty background.

I update the script to enable a watermark. Note that since I have specified that the units be in PIXELS, all my measurements are also in PIXELS

var signature_file    = "C:/temp/dmsx.psd";
var signature_position = BOTTOM_EDGE | CENTER;
var signature_width   = 200;
var signature_height  = 0;
var signature_opacity = 70.0;
var signature_gutter  = border + 5;

The photo then has my logo centered at the bottom

Add EXIF and Custom Text

I want to put a heading with the photo's name and date at the top left, and my name at the center bottom of the photo. I basically modify the text_fields array to contain two text entries:

var text_fields = new Array (
	new Array(
		"%f, %D",             // text
		"Arial",              // font
		12,                   // size
		TOP_EDGE | LEFT_CORNER | TEXT_ALIGN_BORDER // align
	),
	new Array(
		"LEON DANG",          // text
		"Georgia",            // font
		16,                   // size
		BOTTOM_EDGE | CENTER  // align
	),
    );

Change Log

v1.4a

v2.1a

v2.2a

Copyright 2007, Leon Dang