ImgScale Version 2.0.3

Contact:
	Wenny Macura
	wmacu@telus.net

	1]	What is ImgScale?

	2]	Run ImgScale:

	3]	Compile ImgScale:

	4]	Install ImgScale:

	5]	Notes:

_______________________________________________________________________________________________

1]      What is ImgScale?
		-----------------

			ImgScale is a console application used to scale and or subsample single and or multiple Images.
			ImgScale is capable of both pixel-replication and Image Scaling.

			ImgScale uses special scaling algorithm, compare it with Photo Shop, and you may be surprised.

			At this time the input image formats are TIFF, JPEG, BMP, PGM, GIF, TGA, PNG and PPM.

			The output image file will be either TIFF or JPEG depending on the -q option.
			In case -q is set to 0 as in "-q 0" or -q is not used, the output will be a tiff file,
			which may be optionally compressed using the -c option.

			In all other cases the output will be a JPEG file.


_______________________________________________________________________________________________

2]      Run ImgScale:
		-------------
		Just type ImgScale in a console and you will receive the usage info

		ImgScale Usage:
		ImgScale        -i inputFile [ -o OutputFile ] -s ###[%] [-d # ] [-k] [-t] [-c] [-q ###]
						-r### [-?][-h]
				Input File extensions are [.tif/.jpg/.bmp/.pgm/.ppm/.tga]
				Input wildcards are alowed

		-i[--input]     input file(s)
				if -i contains a wildcard, then only the path is extracted from the -o option
		-o[--output]    output path and or file
				if -o is not specified the output will be directed to /tmp
				if only path is specified use the trailing '/' as in [ /foo/ ]
		-s[--size] ###[%]  [ default 400 ]
				Output size in pixels or percent of the original image.
				if % is appended to the ### then the the original image is scaled by percentage as specified
				-a option is not used with [%]
		-q [--quality] ### [ default 66 with -t option]
				JPG output quality of the JPG thumbnail. Usefull range 15 to 95 ( 0 to 100 )
				0 or no argument produces a Bi-cubically scaled TIF image as *.scl
				see also -t option
		-d [--debug] #
				debug level 0 to 5
		-r [--res ] ###.### [default 300.00]
				Output Image Res in dpi.
		-g [--gamma ] ###.### [default 1.00]
				Output Image Gamma.
				Gamma is not applied if no -t or -q options ( scaling ).
		-k [--keephdr]
				Keep the generated Image header files
				The headers are placed to the output directory, see [-o]
		-t [--thumbnail]
				produces a JPEG output with *.tnl extention if -q is not specified default is used
				if -t option is not given, the output file extention will be *.scl
		-c [--compress]
				if -q option is 0 or not specified compress the output TIFF file
		-v [--version]
				display the version number
		-a [--fit_to_square]
				fit the output image into a square defined by the -s option
		-e Outputfile Extention.
		-?, -h print this mesg.



_______________________________________________________________________________________________

3]      Compile ImgScale:
		-----------------
		Check the Makefile for local variables.
		Namelly:
				DEST
				WM_LIB
				LOCAL_LIBRARIES
_______________________________________________________________________________________________

4]      Install ImgScale

			The  Install-sh should do the trick, just open it and check the variables.
_______________________________________________________________________________________________
5]        NOTES:

		A]	NOTE TIFF:
			TIFF images are treated as a special case.
			Not all tiff format variations are  supported.

			To compile the ImgScale the following libraries are required:

							/usr/local/lib/libjpeg
							/usr/local/lib/libtiff
							/usr/local/lib/libWM_ImgLib

		B]	NOTE on WM_ImgLib

				libWM_ImgLib.a    is a link to  WM_ImgLib_02_10_08.a
				libWM_ImgLib.so   is a link to  WM_ImgLib.so.2
				libWM_ImgLib.so.2 is a link to  WM_ImgLib.so.2.10.8


			Sorry libWM_ImgLib is now distributed as an object library only.
			You might get more info by examining the included *.h files, in the ImgLIB_500 directory

			You should ols have a look at the /usr/local/include/Tii/Utility.h
			The Utility class is available through the pUtility pointer, and there you might find,
			few usefull procedures.

			The WM_ImgLib has been compiled for Solaris  as well as HP9000 and seems to work OK.
			Any questions ??

			The WM_ImgLib.htm contains ruther sparse documentation for the WM_ImgLib library.

			Contact "wmacu@telus.net"


		C]
			It is assumed that the  following packages were installed in /usr/local/
			tiff-v3.5.7
			jpeg-6b
			and the associated libraries are in /usr/local/lib or /usr/lib

			These packages are available from "http://www.ibiblio.org/" or mirrors.
			I do believe that they are both, part of most of the linux distributions.

		D]
			If the output file already exist in the destination path, it will not be overwritten !!!
_______________________________________________________________________________________________
6]        EXAMPLE:
			1]  ImgScale -i ./Images/* -o ./Thumbs/ -s 500 -q66 -t -k

				NOTICE the trailing '/' in the -o option !!!
				produces JPEG thumbnails in the ./Thumbs directory
				The thumbnails ( *.tnl ) will have 500 pixels and ( 500 * aspect ratio ) lines.
				The headers (*.hdr) will be placed in the ./Thumbs directory as well

			2]  ImgScale -i ./Images/foo.tif -o ./Thumbs/foo_01.tif -s 10000

				produces scaled TIFF file as ./Thumbs/foo_01.tif. The no of pixels per line will be 10000.
				The aspect ratio of the output image foo_01.tif is preserved.

			3]  ImgScale -i ./Images/*.tif -o ./Thumbs/ -s 1000 -c
				NOTICE the trailing '/' in the -o option !!!
				produces scaled and compressed TIFF files (*.scl ) in the ./Thumbs directory

7]		LIBRARY NOTES:
		The core of the Library is the ImgClass class.
		See the ../Tii/ImgClass.h
		The "SPLIT_IMAGE 1" define, means that for large images, The image is split into
		m100M (128 MB) chunks.( HP allocation ). Hence use the GetLinePtr( LineIndex) to obtain
		pointers to individual image lines.
		
		By default the LUTS RMap,gMap and BMap are not allocated, which assures 1:1 mapping.
