XPhotoEditor 0.1.68 Readme
==========================

COPYRIGHT:
Copyright 1998 by Andreas Soupianas

DISCLAIMER:
This program is distributed it the hope that it will be useful, but
WITHOUT ANY WARRANTY. I will not accept responsibility to anyone for
the consequences of using the program.

COPYING:
This program is (or will be) shareware, but since it is still under 
developement anyone can copy, distribute, and use this program as long as 
they distribute it in whole keeping this and all other files of the 
original distribution. Please do not distribute modified versions of the
program 

REQUIERED:
X-Windows
libjpeg
linux kernel source 
X-Windows headers & libraries
gcc
make

INSTALL:
just untar in a directory and type
make
should make the main file

 if not just compile all the files with
 gcc -c *.c
 and link it with the libjpeg and math libraries
 gcc -o main *.o -lX11 -ljpeg -lm
 if your linker can't find libjpeg.a also include the path with the objects
 gcc -o main *.o /usr/lib/libjpeg.a -lX11 -lm
 if you still can't get it to work make sure you have the include files
 from the linux kernel, include and libraries for X programming, and 
 libjpeg installed correctly.
 if you still can't do it you can sent me the error messages you get at
 ceeas2@eexi.gr and I may be able to help (if I find the time).

RUN:
type:
main
or move the executable to /usr/bin/X11/xphotoeditor and use it from there

SUPPORTED PLATFORMS:
The program should run under most X-servers for Linux and maybe other unixes
It contains support for 8bpp 16bpp and 32bpp Xservers and a general dither
support for all the rest. 
Since my video card does not support true color I am not sure the high byte
display will work as I wrote it on a simulated server.
I have not tested the program with other unixes. It may not work on machines
with different byte-order than intel (at least in some features).


FEATURES:
Read and write jpeg using jpeglib.
Read 8bpp PCX.
Write Postscript for printing
Display and edit up to 16 true color or grayscale images at the same time.
Toolbar that enables you to draw, pick background and foreground color, select
pixels, rectangle areas, freehand selection, magic selection, crop images, and
draw selected areas with gradient color linear and circular.
Filters to create the effect of sharpening, bluring, inverting, embossing and
a horrifying effect. User defined filter will be added soon.
Unlimited zoom in and out.
Blending of images with simple addition or merging with alpha-channel.
Brush toolbar to select fore and back color with rgb values, and prush size.
Report window that displays image refresh and program state.

BUGS:
I haven't yet implemened handling for the failure of some malloc's so if you
don't have a lot of memory the program will crash sometime.
Crop of an 8-bit image creates a 24-bit image, wasting memory (and changing the
format).
If there are not enough free colors in the colormap the display is incorrect.
You should not use other color intensive X clients at the same time with
XPhotoEditor unless you use a 16bit or true color display.
You will get a LOT of debug info in the terminal you run it from.

probably many more

USAGE EXAMPLES:
-To use a menu item just click on it or press the first letter of the menu item 
you want to select. Most of them (if not all) are in capital, so also hold 
Shift or set caps lock state to on e.g. to load a jpeg file hold shift and 
press f to activate the file menu and then holding shift press l. A selection
window appears that shows all the files and directories in the current
directory. Use the mouse to select a file. Click once to activate your 
selection. If your selection is a directory, you change to that directory
and you can select again. If your selection is a jpeg file, it is loaded and
displayed.
If you don't want to wait for the display to finish, click on a non-active area
or press q. The display is not finished but the image is in memory and you can
do stuff on it.
-To create a black image select Create from the File menu. If you want a
different size select Resize from the change menu. Type the X and Y dimensions
you want after giving focus to each area with the mouse and click on OK.
A new image with the size you selected is created.
-You can move images in the display window by dragging them from their title
bar.
-Each image has a menu box at the left top which enables you to Close
(discard) it, save it, Create another of the same size, or refresh it, if it is
not displayed correctly.
-All actions are preformed on the active image which is the one with the light
(usually pink but depends on the display depth) title bar. All the other images
have darker title bars and are inactive. You can select the active image by
clicking on its title bar or moving it.
-To draw a hand drawing click on the draw button in the select toolbar and then
move the mouse to the active image and hold down the left button. A click will
only draw a point, but if you move the mouse with the left button down, you
draw using the current brush selected from the brush window
-To select A color for the foreground click on the Pick Fore button from the
select toolbar and click in the active image. You can also change it by 
selecting ist red green and blue components in the brush window. The same
applies for the background color.
-To select an area of the image for editing, click on the button that shows a
shape in the select toolbar, or select line select from the mode menu. Most
actions in the select toolbar can be also activated from the mode menu. Then
draw an outline in the image: click in the active image. If you want to draw
a freehand drawing keep the left mouse down and move the mouse. If you want
an outline with lines, move the mouse and click in each point of the line. 
When you are done with the outline click the left mouse button twice quickly.
the selection is being made and the image refreshed. The selection is being
added every time you select something, so if you want to discard your selection
you must select N(select none) from the mode menu.
-After you have selected something you can apply any filter or draw a gradient
in it. If there is no selection filters and dradients are applied to the whole
image. To draw a gradient, select the Grad Line or Grad Circ from the select
toolbar and drag in the active image from the point you want to start the 
filling to the point you want to end it. Try it to see what it does. The 
gradient is done from the foreground color to the background for circular
and from back to fore for linear mode.
-To merge two images, make the first one active and select "select second"
from the image menu. A window reports the name of the window selected as
second. Click inside it to close it. Make the other one active. From the image
menu select Add. The second image is now merging the first one to create a
blended result.
-To merge two images using a channeler: You need three images. The two you 
want to blend and a third one to be used as channeler. You can use a grayscale
or color image for channeler. This can be used to blend two images so that
the result looks good by using a gradient image for the chaneller. Suppose
you want to add two images so that the result shows more of the first one
on the left and more of the second on the right. I assume they are of the 
same size. Load the first one and use its menu to create a black of the same
canvas. Then use the linear gradient filling with black foreground and white
background to fill the new image from left to right. From the Image menu
select "Pick channeler". Click on the original image and select from the Image
menu "Select Second". Load the other image and from the Image menu select
"Merge".
-To print an image. From the file menu select "Print PS". At the window asking
you for a file name write a file name and press enter. If you have a postscript
printer on lp1 you can just write /dev/lp1 instead of filename. That will send
the image directly to the printer. If not use ghostscript to print the file
to your printer.
-To load an 8-bit pcx: From the file menu select "Read any (Guess)". At the 
selection window select a pcx file.

SCANNER SUPPORT:
The Acquire menu option requires a driver for a scanner on the device
 /dev/scanner
I have writen a driver for my Qtronix handy color scanner that registers on
major 21 (which may be a bad thing) and sends 4096byte blocks of scanlines
when it is read.
A similar driver should be used for any scanner. XPhotoEditor assumes that
the scanner device sends 4096 bytes for each scanline. Eech scanline is a 
row of RGB bytes, and therefore 4096 bytes are approx 1365 pixels.
My driver is a module only driver and can be found in the scanner subdir.
To use it (if you have a Qtronix scanner on irq 12 and I/O port 100h) make
it and type:
insmod scanmod.o
also make the device file with:
mknod /dev/scanner c 21 0
after using the driver you can remove it with
rmmod scanmod.o

If your scanner is on a different port you can change the driver by altering
the #define IO_PORT 0x100 line at the begining of the scanmod.c file.
The interrupt cannot be changed from 12 by simply changing the
#define IRQ_NUM 12 because each interrupt must also be set at the 3 least
sigificant bits of the outportb(io_port+2,10110XXX:binary) in the 
turn_scanner_on() function.

Date: 5 Sep 1998

