	Photosphere 1.3
	February 2005

	Greg Ward
	Anyhere Software, Unincorporated
	Albany, California
	gward@lmi.net

A really basic quick start guide is provided in the file
"quickstart_pf.txt".  Look there to get started with the
Photosphere application if you are a new user.  Read on
here if you want to learn more about the development
history, features, and methods of this image browsing
and cataloging tool.

Photosphere is an image browser and cataloging application.  I
started developing it in Spring of 2001, under the newly released
Mac OS X, which combines the best of Unix and Mac together into a
reasonably seamless whole.  The first 2-3 months were spent on
system-independent C and C++ libraries, including a database manager,
cache manager, thumbnail manager, and image processing library.
Subsequent work has focused on the GUI development and getting the
darned thing to do what I want.

Photosphere works on local files only, and is not internet savvy at
this time.  It reads and writes JPEG, TIFF, OpenEXR, and
Radiance-RGBE (often called HDR for "high dynamic range") image
formats.  (A BMP file reader was added more recently, but no writer.)

Here is a brief list of goals I had in developing this software:

1.   Track image files rather than managing their location or storage.
2.   Subject, time-line, keyword, owner, and album indexing.
3.   Fast, interactive response for browsing directories or catalogs.
4.   Read and interpret the Exif header information on digital camera images.
5.   Facilities to create and view high dynamic-range images.
6.   Accurate color reproduction.
7.   Automated web page and photo album assembly.
8.   Displayable and editable image information.
9.   Drag and drop functionality.
10.  User-defined database fields.
11.  Direct connection to digital photo printing services.
12.  Portable across platforms (Mac, Unix, Windows).

Of these goals, I'd say I've covered 1-10 pretty well.
Goal 11 will probably have to wait a bit, and 12 is
discussed below.

Portability across platforms is something I'm addressing by
enlisting the help of a friend who can tolerate Windows.  He
has said he would give it a shot, and he's extremely capable,
but I don't think he quite knows yet what he's getting into.
All the library code is portable, and has been compiled under
Windows and Linux already, but some of it is a bit tricky to 
understand and apply in a GUI...  As for Linux, I'm going to
tackle this much later on an "as time permits" basis, which 
is how I've had to approach this entire project.

The current version of the browser, which I'm calling 1.2,
contains the following set of capabilities and features.  Some of
these were secondary goals I originally intended, and some are cool
things that came along as I developed the program:

o    Tracks image files as they are moved from one location to
	another by recording all previously known whereabouts
	and keeping a list of directory migrations.  From the
	user's perspective, the program only asks for
	help every once in a while to find an image.
	The rest of the time, it just seems to know.
o    Image data is never modified by the program.  The user must
	explicitly write out a new file if they wish to change
	an image or write out the displayed pixels.  The image
	is displayed according to field values in its database
	record, including orientation, cropping, red-eye removal, etc.
o    All thumbnails from all catalogs are cached together
	in a thumbnail directory with 6 320x320 thumbnails
	per JPEG contact sheet.  This provides for large
	thumbnail views (previews) even when the original
	images are not present on the system, while reducing
	the storage to the equivalent size of individually
	stored 160x120 thumbnails.
o    When smaller thumbnails are displayed in the browser,
	the preview size is instantly accessible with an
	option-click of the mouse over the thumb.  Other
	information about the image, such as capture date,
	title, keywords, etc., is also displayed in this
	"detail popup."
o    Thumbnail images are associated with image files by the
	original file size and a fast hash on the raw file bytes.
	This allows multiple copies of the same file
	to share thumbnails, and avoids regenerating
	thumbnails of images that have been seen before
	but not cataloged.
o    Interactive browser speed is maintained for digital
	camera images by displaying their Exif thumbnails
	while the higher resolution thumbnails are being
	generated.  The only noticeable delay in looking
	through directories is the time spent generating
	hash values and reading the Exif information,
	which takes less than a tenth of a second per image
	on a slow laptop drive, independent of image size
	and resolution.  Thumbnails of images from a
	catalog display instantly.
o    Large image catalogs don't seem to cause any problems
	for the browser.  I have a database indexing over
	16,000 digital camera images.  It takes about a second
	to load on start-up, and all 16,000 records can
	be pulled up in the browser pane in 2 seconds.
	The most challenging string searches take a fraction of a
	second, and typical keyword searches are too quick to time.
	Dynamiclly generated hash index bitmaps allow the
	database to act like associative memory over a key
	subset of fields, so the most common operation of
	matching up image records takes less than a microsecond.
	This is important if you need to check 1,000
	records against a 10,000 record database
	(10 million pairwise comparisons).
o    Image records use cut and paste with tab-separated
	fields, which may be edited in a text editor or
	spreadsheet program.  Importing and exporting
	records and catalogs to text files is supported
	directly by the browser, facilitating database
	manipulation and conversion.  Only the fields listed
	in the heading are read on import, and Photosphere
	will extract the rest of the information it needs if
	all you give is the location (folder) and file name for
	each image.
o    Entering new images into a catalog is quick and easy.  You
	simply look them up on your file system (or CD-ROM),
	click "Add" and specify a subject (defaults to the
	parent directory's name).  I can add a set of 100
	images in about 2 minutes, including keyword entries.
o     High dynamic-range images may be built up from multiple
	(i.e., bracketed) exposures.  My Olympus C-3040 will take
	5 shots in 1.5 seconds, separated by 1 f-stop each.  (I
	wish it were more.)  I get the JPEG files, select them in
	Photosphere, then pull down the "Make HDR..." item under
	the File menu.  It asks me if I want to use the response
	function it computed previously for the C-3040 or create
	a new one, and if I want it to automatically align my
	exposures (usually a good idea, even with a tripod).  In less
	than a minute, I'm looking at a tone-mapped display of a
	high dynamic-range image, which I can write out in Radiance
	RGBE, OpenEXR, TIFF (float or LogLuv), or JPEG-HDR format.
	I can interactively go up and down on my displayed exposure,
	try out different tone-mapping options, and write out the
	displayed image in a low dynamic-range format such as
	standard JPEG or TIFF 24-bit RGB if I like.
o    HDR creation features include automatic lens flare removal
	and ghost removal.  These can be useful for improving the
	results when there is a substantial amount of light spillover
	from bright areas, or people/objects moving in the scene and
	appearing as ghosts in the combined result.  There is also
	a calibration feature that permits Photosphere to be used
	for light measurement, no warranties of course.
o    Cropping and red-eye removal are useful additions, which make
	the displayed images more pleasing.  The rectangles to crop
	and apply red-eye removal in are stored in fields in the
	database, so nothing is lost and (almost) no additional
	storage is required. 
o    The catalog record information takes up around 512 bytes/image,
	depending on field settings, and another 15 Kbytes/image
	or so for thumbnail storage in the separate thumbnail
	cache.  My 16,000 record database takes 6 Mbytes, plus
	about 230 Mbytes for all the associated thumbnails.
	Considering this DB represents over 15 Gbytes of
	image data, that seems quite reasonable (1.5%) in terms
	of local storage, and the DB fraction is only 0.04% of
	the total.  Since the thumbnails are stored in a cache, a user
	who is short on disk space can specify a suitably small limit
	and avoid even this expense.  Disk usage is often critical for a
	laptop computer, which may have a small internal drive.  Since
	laptops are ideal for handling digital camera data in terms
	of their portability, I considered this an important issue.
o    Memory management is handled within a user-adjustable limit in
	Photosphere.  It doesn't depend on virtual memory for image
	and thumbnail caching, which tends to cause system-wide
	swapping and delays.  Instead, a low-level cache manager
	frees memory as needed based on LRU and the time requirements
	for restoring or regenerating the sub-classed object.  The
	result is snappy thumbnail and image display within a limited
	memory footprint.  (Exceptions to this may occur when really
	large images are loaded that exceed the specified memory limit.)
o    The image processing library uses a C/C++ plug-in architecture,
	which is designed to make it easy to add support for various
	formats.  As soon as I get some time, I intend to link to
	the QuickTime library to leverage all of the image formats Apple
	supports.  I needed to support TIFF directly to get the LogLuv
	stuff to work properly, and floating point images are not
	supported at all by Quicktime, so there was a need to develop
	my own library.  Fortunately, most of the code for this
	was already laying about in one form or another.
o    A new, HDR version of JPEG has been added that stores the
	extended dynamic range in a subband (metadata) marker.
	Standard applications will see a 24-bit, tone-mapped
	RGB image, but Photosphere can extract the original
	dynamic range and color gamut on the receiving end.
	The files are a lot smaller, and can even be included
	on image and web page exports by clicking the "Include
	HDR Image Data" checkbox on the export options dialog.
o    The ability to stitch together panoramas was recently added, using
	a new algorithm that works for standard and HDR images.

The program continues to evolve daily, and I welcome bug reports
and suggestions from everyone.

Enjoy!
-Greg

<gward@lmi.net>
