Utility to crop images on cellphone:
Given that some image has already been selected by some other means,
such as browsing Google image search, make use of cjpeg and djpeg applications on Unix
as follows:
- Size the image to exactly fill usable part of cell-phone screen
(115 pixels wide by 127 pixels tall), ignoring the proper aspect ratio.
- Overlay with grid to show labeled sections for cropping,
divided by 9 equally-spaced grid lines along each dimension, hence divided
into 8 strips per each dimension.
- Generate lossy jpeg to achieve 1k or 2k bytes to minimize
cost of download.
- Display the resultant image in form, allowing user to mark which
range of rows and/or columns to exclude when cropping.
- Include column labels ABCDEFGHI along top+bottom, assume 9 at top
and 1 at bottom.
- User specifies numeric and/or letter range for cropping.
- Server computes new portion of original image per latest cropping
ranges, resamples directly from original image, repeats generation of
grid-marked image in form as above.
- Repeat above steps as many times as user specifies additional
cropping compounded upon previous cropping.
- If user makes mistake, crops too harshly, loses some desired
part of image, pressing back-button returns to previous form with previous
state to allow alterate cropping.
- User finalizes the crop by entering empty crop spec.
- Server resizes image to be exactly 115 pixels wide but to
have correct aspect ratio, which may be short-and-wide wasting bottom
of screen, or very-tall needing vertical
scrolling to see it all.
- User specifies what to do with the final crop-specification,
such as save permanently.
- Note that the cropped+resampled+lossyCompressed image is cached
only briefly, not
saved long-term.
Instead the specification of cropping is saved with link
to original image, thus allowing regeneration of same-crop image at
any desired size (for larger screens) and any desired compression (for
better image quality or less download cost).
Update 2010.Jun.30: About a week ago I started implementing this service,
with some changes in the command structure. See update
here.