Mercurial > hg > cropresize
annotate README.txt @ 8:eb0f4870a019 default tip
depend on pillow which exists
| author | Jeff Hammel <k0scist@gmail.com> |
|---|---|
| date | Tue, 03 Nov 2020 08:04:33 -0800 |
| parents | c89738f3f417 |
| children |
| rev | line source |
|---|---|
| 2 | 1 cropresize |
| 2 ========== | |
| 3 | |
| 5 | 4 cropresize uses `PIL <http://www.pythonware.com/products/pil/>`_ |
| 5 to crop and resize an image as appropriate for web | |
| 2 | 6 presentation. cropresize is a convenience package that allows image |
| 7 resizing without aspect ratio distortion. | |
| 8 | |
| 9 API | |
| 10 --- | |
| 11 | |
| 4 | 12 cropresize contains one useful function, ``cropresize.crop_resize``. |
| 13 The function takes three arguments: | |
| 14 | |
| 5 | 15 * image: a `PIL image <http://www.pythonware.com/library/pil/handbook/image.htm>`_ object |
| 4 | 16 * size: a 2-tuple of (width,height); at least one must be specified |
| 17 * exact_size: whether to scale up for smaller images | |
| 18 | |
| 19 See ``cropresize.crop_resize.__doc__`` for the function | |
| 20 documentation. ``crop_resize`` returns the cropped and resized PIL image. | |
| 21 | |
| 22 | |
| 2 | 23 Command Line |
| 24 ------------ | |
| 25 | |
|
3
2be0070c6f95
path-independent way of getting the description
k0s <k0scist@gmail.com>
parents:
2
diff
changeset
|
26 The command line program, ``crop-resize``, is included in this python |
|
2be0070c6f95
path-independent way of getting the description
k0s <k0scist@gmail.com>
parents:
2
diff
changeset
|
27 package. The help for the program is displayed by running |
|
2be0070c6f95
path-independent way of getting the description
k0s <k0scist@gmail.com>
parents:
2
diff
changeset
|
28 ``crop-resize`` with no arguments or ``crop-resize --help``. |
| 4 | 29 |
| 5 | 30 |
| 31 Future Work | |
| 32 ----------- | |
| 33 | |
| 34 cropresize is written as a convenience function to PIL as this | |
| 35 methodology for cropping and resizing images is often desired for | |
| 36 presentation, particularly on the web. Since the utility is in | |
| 37 demand, the functionality should be ported upstream to PIL. | |
| 38 | |
| 4 | 39 -- |
| 40 | |
| 41 http://k0s.org/portfolio/software.html#cropresize |
