From: Rick W. <ric...@ho...> - 2019-06-09 14:06:08
|
Hi all, A while ago Robert recommended using libgutenprint to dispense single droplets (of any color) at any location on the print medium. This way I can use the xmls with all the properties of the printers to print single droplets with any printer, and don't have to figure out print head offsets if different directions etc. for each printer myself. What I basically want, is to provide some n-by-m-by-c matrix (sparse, with n and m size of the raster, c number of colors the printer can dispense), which will tell for each location (fulfilling the printer resolution 'raster') how many droplets of a certain color channel will be dispensed. As an alternative to using libgutenprint, Robert proposed using the testpattern generator, and gave a short example: #================================================================ # Printer model printer escp2-l120; # Input mode (extended -- raw input, aka DeviceN), 7 channels, 8 bits/pixel) mode extended 6 8; # Input is already dot-by-dot correct parameter DitherAlgorithm Predithered; # Desired printing resolution parameter Resolution 720sw; # ...other input and placement parameters as needed # no output parameters # Specify the input image (in this case a 3x1" microscope slide, say) image 2160 720 ...data... This seems very promising, and is something I'd like to try next, however, how do I create the appropriate 'data'? Could you give an explanation, or point me to some documentation (if existing) in how to compose this data? I suppose that with some general information, I should be able to make some program that can transform my matrix, into some data that can be used for the data in the testpattern. The next step would be to print this testpattern, or to translate it into ESC codes. How is this done? Is it possible to obtain a file with all the ESC commands, that I can send to a printer using e.g. lp -d Epson_P600 -oraw file.prn? I would like to obtain this raw file, to check what will be send to the printer, and perhaps make some minor modifications. Thank you in advance, Kind regards, Rick |
From: Robert K. <rl...@al...> - 2019-06-09 20:23:04
|
On Sun, 9 Jun 2019 14:05:56 +0000, Rick Waasdorp wrote: > Hi all, > > A while ago Robert recommended using libgutenprint to dispense single droplets (of any color) at any location on the print medium. > This way I can use the xmls with all the properties of the printers to print single droplets with any printer, and don't have to figure out print head offsets if different directions etc. for each printer myself. > > What I basically want, is to provide some n-by-m-by-c matrix (sparse, with n and m size of the raster, c number of colors the printer can dispense), which will tell for each location (fulfilling the printer resolution 'raster') how many droplets of a certain color channel will be dispensed. > > As an alternative to using libgutenprint, Robert proposed using the testpattern generator, and gave a short example: > > #================================================================ > # Printer model > printer escp2-l120; > # Input mode (extended -- raw input, aka DeviceN), 7 channels, 8 bits/pixel) > mode extended 6 8; > # Input is already dot-by-dot correct > parameter DitherAlgorithm Predithered; > # Desired printing resolution > parameter Resolution 720sw; > # ...other input and placement parameters as needed > # no output parameters > # Specify the input image (in this case a 3x1" microscope slide, say) > image 2160 720 > ...data... > > This seems very promising, and is something I'd like to try next, however, how do I create the appropriate 'data'? > Could you give an explanation, or point me to some documentation (if existing) in how to compose this data? I suppose that with some general information, I should be able to make some program that can transform my matrix, into some data that can be used for the data in the testpattern. This isn't documented; it's more of an escape hatch than anything else. The format is unsigned binary, pixel-packed, native endian (if you were using 16 bit input), with the ordering of the colors based on the channels listed in the inks .xml file. To find that file, first look in src/xml/printers.xml (for 5.2) or src/xml/printers/escp2.xml (for 5.3) and find your printer. In this case: <printer translate="name" name="Epson L120" driver="escp2-l120" manufacturer="Epson" model="80" parameters="cx3500_params" /> indicates that the model # is 80. Next, look in src/xml/escp2/model/model_80.xml for the inkGroup definition: <inkGroup src="escp2/inks/c82.xml"/> and from that, look in src/xml/escp2/inks/c82.xml (which is a 4-color printer, so you'd need "mode extended 4 8", as there's no 6-color extended mode for that printer). The definition for that is: <InkName translate="text" name="PhysicalCMYK" text="Four Color Raw" InkID="Extended"> The channels for that printer are, in order, black, cyan, magenta, and yellow, indicating that you would need to order the colors within each pixel KCMY. For a more complicated example, let's assume that the inks resolved to f360_photo.xml and you wanted to use 6-color raw (extended) mode. The channels there are black, cyan, light cyan, magenta, light magenta, and yellow, indicating that you would need to specify the colors within each pixel in that order. > The next step would be to print this testpattern, or to translate it into ESC codes. How is this done? Is it possible to obtain a file with all the ESC commands, that I can send to a printer using e.g. lp -d Epson_P600 -oraw file.prn? I would like to obtain this raw file, to check what will be send to the printer, and perhaps make some minor modifications. You would use ./testpattern < testfile.test | lp -oraw -d<printer> -- Robert Krawitz <rl...@al...> *** MIT Engineers A Proud Tradition http://mitathletics.com *** Member of the League for Programming Freedom -- http://ProgFree.org Project lead for Gutenprint -- http://gimp-print.sourceforge.net "Linux doesn't dictate how I work, I dictate how Linux works." --Eric Crampton |
From: Rick W. <ric...@ho...> - 2019-06-11 16:01:40
Attachments:
testpattern_rw.test
|
Hi Robert, Thank you for your prompt reply. I have some troubles in getting the testpattern generator working. Using it with the provided 'testpattern.sample' (./testpattern < terpattern.sample > output.prn) works fine, however, when trying to provide image data, it fails. I made the attached testpattern test file, for the Epson SC P600. This is an 8 color printer, so I set mode extended 8 8; Then I choose a resolution (720sw), and then the parameters InputSlot, MediaType and PageSize (which I don't think I need to set when considering raw input). Then the image specified as specified in the attached file, but this probably is not right. Could you give an example of how to put in the data here? I thought hex bytes (so 0, 1, 2, or 3 for none, small, med, large droplet, in correspondence to 00, 01, 10, 11), but whatever I try , hex, and then I mean , when running the file using: ./testpattern < testpattern_rw.test > test.prn I get "Floating point exception (core dumped)" in the terminal. How do I provide the (packed?) pixel data? The testpattern_rw.test file is parsed using some script (or even multiple?), but I cannot really figure out what is happening exactly, so I have no idea where I can look at the source to see how the 'image' command is used. Could you give me some pointers, or do you think I shouldn't bother? (considering my meh C programming skills haha) Many thanks, Rick -----Original Message----- From: Robert Krawitz <rl...@al...> Sent: Sunday, June 9, 2019 22:23 To: Rick Waasdorp <ric...@ho...> Cc: gim...@li... Subject: Re: libgutenprint and testpattern generator On Sun, 9 Jun 2019 14:05:56 +0000, Rick Waasdorp wrote: > Hi all, > > A while ago Robert recommended using libgutenprint to dispense single droplets (of any color) at any location on the print medium. > This way I can use the xmls with all the properties of the printers to print single droplets with any printer, and don't have to figure out print head offsets if different directions etc. for each printer myself. > > What I basically want, is to provide some n-by-m-by-c matrix (sparse, with n and m size of the raster, c number of colors the printer can dispense), which will tell for each location (fulfilling the printer resolution 'raster') how many droplets of a certain color channel will be dispensed. > > As an alternative to using libgutenprint, Robert proposed using the testpattern generator, and gave a short example: > > #================================================================ > # Printer model > printer escp2-l120; > # Input mode (extended -- raw input, aka DeviceN), 7 channels, 8 > bits/pixel) mode extended 6 8; # Input is already dot-by-dot correct > parameter DitherAlgorithm Predithered; # Desired printing resolution > parameter Resolution 720sw; # ...other input and placement parameters > as needed # no output parameters # Specify the input image (in this > case a 3x1" microscope slide, say) image 2160 720 ...data... > > This seems very promising, and is something I'd like to try next, however, how do I create the appropriate 'data'? > Could you give an explanation, or point me to some documentation (if existing) in how to compose this data? I suppose that with some general information, I should be able to make some program that can transform my matrix, into some data that can be used for the data in the testpattern. This isn't documented; it's more of an escape hatch than anything else. The format is unsigned binary, pixel-packed, native endian (if you were using 16 bit input), with the ordering of the colors based on the channels listed in the inks .xml file. To find that file, first look in src/xml/printers.xml (for 5.2) or src/xml/printers/escp2.xml (for 5.3) and find your printer. In this case: <printer translate="name" name="Epson L120" driver="escp2-l120" manufacturer="Epson" model="80" parameters="cx3500_params" /> indicates that the model # is 80. Next, look in src/xml/escp2/model/model_80.xml for the inkGroup definition: <inkGroup src="escp2/inks/c82.xml"/> and from that, look in src/xml/escp2/inks/c82.xml (which is a 4-color printer, so you'd need "mode extended 4 8", as there's no 6-color extended mode for that printer). The definition for that is: <InkName translate="text" name="PhysicalCMYK" text="Four Color Raw" InkID="Extended"> The channels for that printer are, in order, black, cyan, magenta, and yellow, indicating that you would need to order the colors within each pixel KCMY. For a more complicated example, let's assume that the inks resolved to f360_photo.xml and you wanted to use 6-color raw (extended) mode. The channels there are black, cyan, light cyan, magenta, light magenta, and yellow, indicating that you would need to specify the colors within each pixel in that order. > The next step would be to print this testpattern, or to translate it into ESC codes. How is this done? Is it possible to obtain a file with all the ESC commands, that I can send to a printer using e.g. lp -d Epson_P600 -oraw file.prn? I would like to obtain this raw file, to check what will be send to the printer, and perhaps make some minor modifications. You would use ./testpattern < testfile.test | lp -oraw -d<printer> -- Robert Krawitz <rl...@al...> *** MIT Engineers A Proud Tradition http://mitathletics.com *** Member of the League for Programming Freedom -- http://ProgFree.org Project lead for Gutenprint -- http://gimp-print.sourceforge.net "Linux doesn't dictate how I work, I dictate how Linux works." --Eric Crampton |
From: Rick W. <ric...@ho...> - 2019-06-14 14:54:16
|
Ok looking at pixel packing, what I did before makes no sense. However, I still don't understand what data I have to provide. Do I understand correctly that when using an 8 color printer (e.g. P600), I have to use 16 bits per pixel? Since every pixel can have 8 colors, for which the droplet size has to be supplied as either '00', '01', '10' or '11' (binary drop sizes), so I require 2 bits per color per pixel = 16 bits/pixel. Do I then convert this entire binary string to hex, and copy paste that? Doing that results again in the same "Floating point exception (core dumped)". Leaving it binary, same. Could you give a tiny example of how to use the `image` command? Rick -----Original Message----- From: Rick Waasdorp Sent: Tuesday, June 11, 2019 18:01 To: 'Robert Krawitz' <rl...@al...> Cc: gim...@li... Subject: RE: libgutenprint and testpattern generator Hi Robert, Thank you for your prompt reply. I have some troubles in getting the testpattern generator working. Using it with the provided 'testpattern.sample' (./testpattern < terpattern.sample > output.prn) works fine, however, when trying to provide image data, it fails. I made the attached testpattern test file, for the Epson SC P600. This is an 8 color printer, so I set mode extended 8 8; Then I choose a resolution (720sw), and then the parameters InputSlot, MediaType and PageSize (which I don't think I need to set when considering raw input). Then the image specified as specified in the attached file, but this probably is not right. Could you give an example of how to put in the data here? I thought hex bytes (so 0, 1, 2, or 3 for none, small, med, large droplet, in correspondence to 00, 01, 10, 11), but whatever I try , hex, and then I mean , when running the file using: ./testpattern < testpattern_rw.test > test.prn I get "Floating point exception (core dumped)" in the terminal. How do I provide the (packed?) pixel data? The testpattern_rw.test file is parsed using some script (or even multiple?), but I cannot really figure out what is happening exactly, so I have no idea where I can look at the source to see how the 'image' command is used. Could you give me some pointers, or do you think I shouldn't bother? (considering my meh C programming skills haha) Many thanks, Rick -----Original Message----- From: Robert Krawitz <rl...@al...> Sent: Sunday, June 9, 2019 22:23 To: Rick Waasdorp <ric...@ho...> Cc: gim...@li... Subject: Re: libgutenprint and testpattern generator On Sun, 9 Jun 2019 14:05:56 +0000, Rick Waasdorp wrote: > Hi all, > > A while ago Robert recommended using libgutenprint to dispense single droplets (of any color) at any location on the print medium. > This way I can use the xmls with all the properties of the printers to print single droplets with any printer, and don't have to figure out print head offsets if different directions etc. for each printer myself. > > What I basically want, is to provide some n-by-m-by-c matrix (sparse, with n and m size of the raster, c number of colors the printer can dispense), which will tell for each location (fulfilling the printer resolution 'raster') how many droplets of a certain color channel will be dispensed. > > As an alternative to using libgutenprint, Robert proposed using the testpattern generator, and gave a short example: > > #================================================================ > # Printer model > printer escp2-l120; > # Input mode (extended -- raw input, aka DeviceN), 7 channels, 8 > bits/pixel) mode extended 6 8; # Input is already dot-by-dot correct > parameter DitherAlgorithm Predithered; # Desired printing resolution > parameter Resolution 720sw; # ...other input and placement parameters > as needed # no output parameters # Specify the input image (in this > case a 3x1" microscope slide, say) image 2160 720 ...data... > > This seems very promising, and is something I'd like to try next, however, how do I create the appropriate 'data'? > Could you give an explanation, or point me to some documentation (if existing) in how to compose this data? I suppose that with some general information, I should be able to make some program that can transform my matrix, into some data that can be used for the data in the testpattern. This isn't documented; it's more of an escape hatch than anything else. The format is unsigned binary, pixel-packed, native endian (if you were using 16 bit input), with the ordering of the colors based on the channels listed in the inks .xml file. To find that file, first look in src/xml/printers.xml (for 5.2) or src/xml/printers/escp2.xml (for 5.3) and find your printer. In this case: <printer translate="name" name="Epson L120" driver="escp2-l120" manufacturer="Epson" model="80" parameters="cx3500_params" /> indicates that the model # is 80. Next, look in src/xml/escp2/model/model_80.xml for the inkGroup definition: <inkGroup src="escp2/inks/c82.xml"/> and from that, look in src/xml/escp2/inks/c82.xml (which is a 4-color printer, so you'd need "mode extended 4 8", as there's no 6-color extended mode for that printer). The definition for that is: <InkName translate="text" name="PhysicalCMYK" text="Four Color Raw" InkID="Extended"> The channels for that printer are, in order, black, cyan, magenta, and yellow, indicating that you would need to order the colors within each pixel KCMY. For a more complicated example, let's assume that the inks resolved to f360_photo.xml and you wanted to use 6-color raw (extended) mode. The channels there are black, cyan, light cyan, magenta, light magenta, and yellow, indicating that you would need to specify the colors within each pixel in that order. > The next step would be to print this testpattern, or to translate it into ESC codes. How is this done? Is it possible to obtain a file with all the ESC commands, that I can send to a printer using e.g. lp -d Epson_P600 -oraw file.prn? I would like to obtain this raw file, to check what will be send to the printer, and perhaps make some minor modifications. You would use ./testpattern < testfile.test | lp -oraw -d<printer> -- Robert Krawitz <rl...@al...> *** MIT Engineers A Proud Tradition http://mitathletics.com *** Member of the League for Programming Freedom -- http://ProgFree.org Project lead for Gutenprint -- http://gimp-print.sourceforge.net "Linux doesn't dictate how I work, I dictate how Linux works." --Eric Crampton |