gimpprint_42.html   [plain text]


<HTML>
<HEAD>
<!-- This HTML file has been created by texi2html 1.51
     from .././gimpprint.texi on 22 January 2003 -->

<TITLE>GIMP-Print - Epson inkjet printers</TITLE>
</HEAD>
<BODY>
Go to the <A HREF="gimpprint_1.html">first</A>, <A HREF="gimpprint_41.html">previous</A>, <A HREF="gimpprint_43.html">next</A>, <A HREF="gimpprint_47.html">last</A> section, <A HREF="gimpprint_toc.html">table of contents</A>.
<P><HR><P>


<H2><A NAME="SEC57" HREF="gimpprint_toc.html#TOC57">D.3  Epson inkjet printers</A></H2>
<P>
<A NAME="IDX263"></A>

</P>
<P>
The <SAMP>`model_capabilities'</SAMP> vector in <TT>`print-escp2.c'</TT> contains
one entry for each defined printer model.  The <SAMP>`model'</SAMP> parameter in
<TT>`printers.xml'</TT> is an index into this table.

</P>
<P>
In general, the new printers have fewer eccentricities than the older
printers.  That doesn't mean they're simpler, just that they're more
consistent.

</P>
<P>
An <CODE>escp2_printer_t</CODE> is a C struct defined as follows:

</P>
<P>
<DL>
<DT><U>Data type:</U>  <B>escp2_printer_t</B>
<DD><A NAME="IDX264"></A>

<PRE>
typedef struct escp2_printer
{
  model_cap_t	flags;		/* Bitmask of flags, see below */
/*****************************************************************************/
  int		nozzles;	/* Number of nozzles per color */
  int		min_nozzles;	/* Minimum number of nozzles per color */
  int		nozzle_separation; /* Separation between rows, in 1/360" */
  int		black_nozzles;	/* Number of black nozzles (may be extra) */
  int		min_black_nozzles;	/* # of black nozzles (may be extra) */
  int		black_nozzle_separation; /* Separation between rows */
/*****************************************************************************/
  int		xres;		/* Normal distance between dots in */
				/* softweave mode (inverse inches) */
  int		enhanced_xres;	/* Distance between dots in highest */
				/* quality modes */
  int		base_separation; /* Basic unit of row separation */
  int		base_resolution; /* Base hardware spacing (above this */
				/* always requires multiple passes) */
  int		enhanced_resolution;/* Above this we use the */
				    /* enhanced_xres rather than xres */
  int		resolution_scale;   /* Scaling factor for ESC(D command */
  int		max_black_resolution; /* Above this resolution, we */
				      /* must use color parameters */
				      /* rather than (faster) black */
				      /* only parameters*/
  int		max_hres;
  int		max_vres;
  int		min_hres;
  int		min_vres;
/*****************************************************************************/
  int		max_paper_width; /* Maximum paper width, in points */
  int		max_paper_height; /* Maximum paper height, in points */
  int		min_paper_width; /* Maximum paper width, in points */
  int		min_paper_height; /* Maximum paper height, in points */
				/* Softweave: */
  int		left_margin;	/* Left margin, points */
  int		right_margin;	/* Right margin, points */
  int		top_margin;	/* Absolute top margin, points */
  int		bottom_margin;	/* Absolute bottom margin, points */
				/* "Micro"weave: */
  int		m_left_margin;	/* Left margin, points */
  int		m_right_margin;	/* Right margin, points */
  int		m_top_margin;	/* Absolute top margin, points */
  int		m_bottom_margin;	/* Absolute bottom margin, points */
/*****************************************************************************/
  int		extra_feed;	/* Extra distance the paper can be spaced */
				/* beyond the bottom margin, in 1/360". */
				/* (maximum useful value is */
				/* nozzles * nozzle_separation) */
  int		separation_rows; /* Some printers require funky spacing */
				/* arguments in microweave mode. */
  int		pseudo_separation_rows;/* Some printers require funky */
				/* spacing arguments in softweave mode */

  int           zero_margin_offset;   /* Offset to use to achieve */
				      /* zero-margin printing */
/*****************************************************************************/
		 /* The stylus 480 and 580 have an unusual arrangement of
				  color jets that need special handling */
  const int *head_offset;
  int		initial_vertical_offset;
  int		black_initial_vertical_offset;

/*****************************************************************************/
  const int *dot_sizes;		/* Vector of dot sizes for resolutions */
  const double *densities;	/* List of densities for each printer */
  const escp2_variable_inklist_t *inks; /* Choices of inks for this printer */
/*****************************************************************************/
  const double *lum_adjustment;
  const double *hue_adjustment;
  const double *sat_adjustment;
  const paperlist_t *paperlist;
} escp2_printer_t;
</PRE>

</DL>

<P>
The printer definition block is divided into 8 sections.  The first
section is a set of miscellaneous printer options.  These are
described in the code, and will not be discussed further here.

</P>

<P>
The second section describes the number of nozzles and the separation
between nozzles in base units.  The base unit is 1/360" for all
currently supported printers, but future printers may support a
smaller base unit.

</P>
<P>
Many printers have more black nozzles than nozzles of other colors,
and when used in black and white mode, it's possible to use these
extra nozzles, which speeds up printing.  As an example, a printer
that is specified to have 48 cyan, magenta, and yellow nozzles, and
144 black nozzles, can use all 144 black nozzles when printing black
ink only.  When printing in color, only 48 nozzles of each color
(including black) can be used.

</P>
<P>
Most printers can print using either the number of nozzles available
or any smaller number.  Some printers require that all of the nozzles
be used.  Those printers will set <CODE>min_nozzles</CODE> and/or
<CODE>min_black_nozzles</CODE> to the same value as <CODE>nozzles</CODE> and/or
<CODE>black_nozzles</CODE>.

</P>

<P>
The third section defines basic units of measure for the printer,
including the standard separation between dots, the base nozzle
separation, and the minimum and maximum printing resolutions the
printer supports.  Most of these are fairly self-explanatory, but some
are not obvious.

</P>
<P>
Most Epson printers, other than the high-end Stylus Pro models, cannot
print dots spaced more closely than 1/360" or 1/720" apart (this is
the setting for <CODE>xres</CODE>.  This is true even for printers that
support resolutions of 1440 or 2880 DPI.  In these cases, the data
must be printed in 2, 4, or 8 passes.  While the printer can position
the head to a resolution of 1/1440" or 1/2880", the head cannot
deposit ink that frequently.

</P>
<P>
Some printers can only print in their very best quality (using the
smallest dots available) printing at a lower resolution.  For example,
the Stylus Photo EX can normally print with a dot spacing of 1/720".
The smallest dot size cannot be printed with a dot spacing of less
than 1/360", however.  In this case, we use <CODE>enhanced_xres</CODE>
to specify the resolution to be used in this enhanced mode, and
<CODE>enhanced_resolution</CODE> to specify the printing resolution above
which we use the <CODE>enhanced_xres</CODE>.

</P>
<P>
The <CODE>resolution_scale</CODE> command is used to specify scaling factors
for the dot separation on newer printers.  It should always be 14400
with current printers.

</P>

<P>
The fourth section specifies the minimum and maximum paper sizes, and
the margins.  Some printers allow use of narrower margins when
softweave is used; both sets of margins are specified.

</P>
<P>
There is a convenient <SAMP>`INCH'</SAMP> macro defined to make specification of
the <CODE>max_paper_width</CODE> and <CODE>max_paper_height</CODE> more legible.  It
multiplies 72 by the provided expression to get the appropriate number
of points.  For example, to specify 8.5", <SAMP>`INCH(17/2)'</SAMP> expands to
<SAMP>`(72 * 17/2)'</SAMP>, which is evaluated left to right, and hence
generates the correct value.

</P>

<P>
The fifth section specifies some miscellaneous values that are
required for certain printers.  For most printers, the correct values
are 1 for <CODE>separation_rows</CODE> and 0 for the others.  Very, very few
printers require (or allow) <CODE>separation_rows</CODE> to be anything but
1 and <CODE>pseudo_separation_rows</CODE> other than zero.  The Stylus Color
1520, Stylus Color 800, Stylus Color 850, and (strangely enough to my
mind, since it's a new printer) Stylus Color 660 seem to be the only
exceptions.

</P>
<P>
The <CODE>zero_margin_offset</CODE> is used to specify an additional
negative horizontal offset required to print to the edges of the paper
on newer Stylus Photo printers.  These must be determined empirically;
good starting values are 100 for 1440 DPI and 50 for 2880 DPI
printers.  The goal is to print to the edge of the page, but not over
it.

</P>

<P>
The sixth section specifies head offsets for printers that do not have
the color jets aligned.  Certain printers, such as the Stylus Color
480, have an unusual head arrangement whereby instead of all of the
colors being aligned vertically, the nozzles are configured in
groups.  These printers are easy to determine; if the normal head
offset of zero for each color is used, the printing will be vertically
out of alignment.  Most of these printers require specification of a
negative offset for printing to the top edge of the paper; typically
these printers do not require such an offset when printing black only.

</P>
<P>
The seventh section specifies the most difficult values to tune, the
dot sizes, printing densities, and ink values (for variable dot size
enabled printers).  These will be described in detail below.

</P>

<P>
The last section specifies luminosity, hue, and saturation adjustment
vectors for the printer, and the paper definitions.  These are used to
adjust the color in Photograph and Solid Colors output modes.  These are
each vectors of 48 (actually 49, as the first value must be duplicated)
doubles that remap the luminosity, hue, and saturation respectively.
The hue is calculated, and the value used to interpolate between the two
closest points in each vector.

</P>
<P>
The paper definitions is a set of paper definitions.  The paper
definition contains the name of the paper type, special settings that
are required for printers to process the paper correctly, and a set of
adjustment values.  These are not currently discussed here.

</P>

<P>
The lists of dot sizes and densities contain values for 13 printing
modes: 120/180 DPI using printer weaving (single row; incorrectly
referred to as "microweave") and "soft" weaving (the driver
determines the exact pattern of dot layout), 360 DPI microweave and
softweave, 720x360 DPI microweave and softweave, 720 DPI microweave
and softweave, 1440x720 microweave and softweave, 2880x720 microweave
and softweave, and 2880x1440 softweave only.  Printer weaving is
referred to as "microweave" for historical reasons.

</P>
<P>
For the dot sizes, the value for each element in the vector selects
the dot size to be used when printing at this (or similar)
resolution.  The dot sizes are determined by consulting the
programming manual for the printer and experimenting as described
below.  Current Epson printers always use dot sizes less than
<SAMP>`16'</SAMP>, or <SAMP>`0x10'</SAMP>, to indicate single dot size (each dot is
represented by 1 bit, and it's either printed or not), and dot sizes
of <SAMP>`16'</SAMP> or greater to indicate variable dot size (each dot is
represented by 2 bits, and it can either be not printed or take on 2
or 3 values, representing the relative size of the printed dot).
Variable dot sizes permit the use of very small dots (which would be
too small to fill the page and produce solid black) in light areas,
while allowing the page to be filled with larger dots in darker areas.

</P>
<P>
Even single dot size printers can usually produce dots of different
sizes; it's just illegal to actually try to switch dot size during a
page.  These dots are also much bigger than those used in true
variable dot size printing.

</P>
<P>
A dot size of <SAMP>`-1'</SAMP> indicates that this resolution is illegal for
the printer in question.  Any resolutions that would use this dot size
will not be presented to the user.  A dot size of <SAMP>`-2'</SAMP> indicates
that this resolution is legal, but that the driver is not to attempt
to set any dot size.  Some very old printers do not support the
command to set the dot size.

</P>
<P>
Most printers support a dot size of <SAMP>`0'</SAMP> as a mode-specific default,
but it's often a bigger dot than necessary.  Printers usually also
support some dot sizes between <SAMP>`1'</SAMP> and <SAMP>`3'</SAMP>.  Usually <SAMP>`1'</SAMP>
is the right dot size for 720 and 1440 dpi printing, and <SAMP>`3'</SAMP> works
best at 360 dpi.

</P>
<P>
Variable dot size printers usually support 2 or 3 sets of variable dot
sizes.  Older printers based on a 6 picolitre drop (the 480, 720, 740,
750, 900, and 1200) support two: mode 16 (0x10 in hexadecimal) for
normal variable dots at 1440 or 720 dpi, and mode 17 (0x10) for
special larger dots at 360 dpi.  Newer printers based on 4 picolitre
drops normally support three sizes: <SAMP>`0x10'</SAMP> for 4 pl base drops,
<SAMP>`0x11'</SAMP> for 6 pl base drops, and <SAMP>`0x12'</SAMP> for special large
drops.  On these printers, <SAMP>`0x10'</SAMP> usually works best at 1440x720
and <SAMP>`0x11'</SAMP> works best at 720x720.  Unfortunately, <SAMP>`0x10'</SAMP>
doesn't seem to generate quite enough density at 720x720, because if
it did the output would be very smooth.  Perhaps it's possible to
tweak things@enddots{}

</P>

<P>
The list of densities is a list of base density values for all of the
above listed modes.  "Density" refers to the amount of ink deposited
when a solid color (or solid black) is printed.  So if the density is
<SAMP>`.5'</SAMP>, solid black actually prints only half the possible dots.
"Base density" refers to the fact that the density value can be
scaled in the GUI or on the Ghostscript command line.  The density
value specified (which is not made visible to the user) is multiplied
by the base density to obtain the effective density value.  All other
things (such as ink drop size) remaining the same, doubling the
resolution requires halving the base density.  The base density in the
density vector may exceed <SAMP>`1'</SAMP>, as many paper types require lower
density than the base driver.  The driver ensures that the actual
density never exceeds 1.

</P>
<P>
Tuning the density should be done on high quality paper (usually
glossy photo paper).  The goal is to find the lowest density value
that results in solid black (no visible gaps under a fairly high power
magnifying glass or loupe).  If an appropriate density value is found
for 720 DPI, it could be divided by 2 for 1440x720, by 4 for 2880x720,
and by 8 for 2880x1440.

</P>
<P>
However, for printers that offer a choice of dot size, this may not be
the best strategy.  The best choice for dot size is the smallest dot
size that allows choosing a density value not greater than 1 that
gives full coverage.  This dot size may be different for different
resolutions.  Tuning variable dot size printers is more complicated;
the process is described below.

</P>
<P>
The last member is a pointer to a structure containing a list of ink
values for variable dot size (or 6 color) inks.  We model variable dot
size inks as producing a certain "value" of ink for each available dot
size, where the largest dot size has a value of 1.  6-color inks are
handled similarly; the light cyan and light magenta inks are treated
as a fractional ink value.  The combination of variable dot size and 6
color inks, of course, just creates that many more different ink
choices.

</P>
<P>
This structure is actually rather complicated; it contains entries for
each combination of physical printer resolution (180, 360, 720, and
1440 dpi), ink colors (4, 6, and 7), and single and variable dot sizes
(since some printer modes can't handle variable dot size inks).  Since
there's so much data, it's actually a somewhat deeply nested
structure:

</P>
<P>
An <CODE>escp2_printer_t</CODE> contains a pointer (essentially, a reference
rather than a copy) to an <CODE>escp2_variable_inklist_t</CODE>.

</P>
<P>
An <CODE>escp2_variable_inklist_t</CODE> contains pointers to
<CODE>escp2_variable_inkset_t</CODE> structures.  There is one such pointer
for each combination of resolution, dot type, and ink colors as
described above.  Yes, this is rather inflexible.

</P>
<P>
An <CODE>escp2_variable_inkset_t</CODE> contains pointers to
<CODE>escp2_variable_ink_t</CODE> structures.  There is one such pointer for
each of the four colors (C, M, Y, and K).

</P>
<P>
An <CODE>escp2_variable_ink_t</CODE> contains a pointer to the actual list of
ink values (<CODE>simple_dither_range_t</CODE>), the number of ink values, and
a density value to be used for computing the transitions.  This density
value is actually a scaling value; it is multiplied by the effective
density to compute the density to be used for computing the transitions.
Normally, this value is <SAMP>`1'</SAMP>, but in some cases it may be possible
to get smoother results with a different value (in particular, the
single dot size 6-color inks work best with the effective density scaled
to <SAMP>`.75'</SAMP> for this purpose).  A lower density lowers the transition
points, which results in more ink being deposited.

</P>
<P>
A <CODE>simple_dither_range_t</CODE> is a structure containing four values:

</P>

<OL>
<LI>The value of the particular ink

<LI>The bit pattern used to represent the ink

<LI>Whether the ink is light (0) or dark (1), for inks with light and dark variants

<LI>The relative amount of ink actually deposited by this dot (not

currently used for much; it can be used for ink reduction purposes, to
reduce the amount of ink deposited on the paper).
</OL>

<P>
These things are interesting as arrays.  From an array of
<CODE>simple_dither_range_t</CODE>'s, the dither code computes transition
values that it looks up at run time to decide what ink to print, as well
as whether to print at all.

</P>
<P>
<STRONG>Really</STRONG> confused now?  Yup.  You'll probably find it easier to
simply read the code.

</P>

<P><HR><P>
Go to the <A HREF="gimpprint_1.html">first</A>, <A HREF="gimpprint_41.html">previous</A>, <A HREF="gimpprint_43.html">next</A>, <A HREF="gimpprint_47.html">last</A> section, <A HREF="gimpprint_toc.html">table of contents</A>.
</BODY>
</HTML>