Trees | Indices | Help |
|
---|
|
components/tools/OmeroPy/src/omero/util/imageUitl.py ----------------------------------------------------------------------------- Copyright (C) 2006-2009 University of Dundee. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. ------------------------------------------------------------------------------ A collection of utility methods based on the Python Imaging Library (PIL) used for making figures. @author William Moore <a href="mailto:will@lifesci.dundee.ac.uk">will@lifesci.dundee.ac.uk</a> @author Jean-Marie Burel <a href="mailto:j.burel@dundee.ac.uk">j.burel@dundee.ac.uk</a> @author Donald MacDonald <a href="mailto:donald@lifesci.dundee.ac.uk">donald@lifesci.dundee.ac.uk</a> @version 3.0 <small> (<b>Internal version:</b> $Revision: $Date: $) </small> @since 3.0-Beta4.1
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|
|||
GATEWAYPATH = os.path.dirname(os.path.abspath(__file__))
|
Imports: Image, ImageDraw, ImageFont, os, omero, StringIO
|
Returns a PIL ImageFont Sans-serif true-type font of the specified size or a pre-compiled font of fixed size if the ttf font is not found
|
Pastes the image onto the canvas at the specified coordinates Image and canvas are instances of PIL 'Image'
|
Returns a thumbnail (as string) from the pixelsId, the longest side is 'length'
|
Returns map of thumbnails whose keys are the pixels id and the values are the image, the longest side is 'length'
|
Retrieves thumbnails for each pixelId, and places them in a grid, with White background. Option to add a vertical label to the left of the canvas Creates a PIL 'Image' which is returned
|
Checks that the value is between 0 and 255. Returns integer value If the value is not valid, return 255 (better to see something than nothing! )
|
Returns a tuple of (r,g,b,a) from an integer colour r, g, b, a are 0-255.
|
Returns a tuple of (r,g,b) from an integer colour r, g, b are 0-255.
|
Returns the factor by which the Image has to be shrunk so that it's dimensions are less that maxW and maxH E.g. If the image must be half-sized, this method returns 2.0 (float)
|
Resize the image so that it is as big as possible, within the dimensions maxW, maxH
|
Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Tue Oct 18 13:28:32 2011 | http://epydoc.sourceforge.net |