Portál AbcLinuxu, 29. října 2025 05:03
Má někdo ponětí jak se dostat nějakým jednoduchým způsobem do nativního rozlišení které tiskárna zvládne abych se interpolaci v rasterovací jednotce vyhnul a laser mi tiskl pixely tak jak to dokáže? Samozřejmě bez nějakých těžkých hacků poněvadž tiskárna není moje.
Tisk provádím tak že si nachystám PostScript a pak ho tam pomocí jakési nativní aplikace pošlu přes TCP port. Tiskárna je Develop Ineo 220, ale vzhledem k tomu že před tím tam byla KONICA MINOLTA a že jsem zkoušel tisk pod Linuxem na obou vím že mají naprosto stejné jádro, funguje na ně úplně ten stejný driver a v podstatě je to pouze generuje PostScript který se tam PDLkem přes síť nacpe.
V příloze připojuju fotky z mikroskopu.
V Postscriptu nic zvláštního k nastavení ani nevidím:
%!PS-Adobe-3.0
%%Creator: (ImageMagick)
%%Title: (optar_out_0001.ps)
%%CreationDate: (2017-02-21T18:02:50+01:00)
%%BoundingBox: 19 17 576 822
%%HiResBoundingBox: 19 17 576 822
%%DocumentData: Clean7Bit
%%LanguageLevel: 1
%%Orientation: Portrait
%%PageOrder: Ascend
%%Pages: 1
%%EndComments
%%BeginDefaults
%%EndDefaults
%%BeginProlog
%
% Display a color image. The image is displayed in color on
% Postscript viewers or printers that support color, otherwise
% it is displayed as grayscale.
%
/DirectClassPacket
{
%
% Get a DirectClass packet.
%
% Parameters:
% red.
% green.
% blue.
% length: number of pixels minus one of this color (optional).
%
currentfile color_packet readhexstring pop pop
compression 0 eq
{
/number_pixels 3 def
}
{
currentfile byte readhexstring pop 0 get
/number_pixels exch 1 add 3 mul def
} ifelse
0 3 number_pixels 1 sub
{
pixels exch color_packet putinterval
} for
pixels 0 number_pixels getinterval
} bind def
/DirectClassImage
{
%
% Display a DirectClass image.
%
systemdict /colorimage known
{
columns rows 8
[
columns 0 0
rows neg 0 rows
]
{ DirectClassPacket } false 3 colorimage
}
{
%
% No colorimage operator; convert to grayscale.
%
columns rows 8
[
columns 0 0
rows neg 0 rows
]
{ GrayDirectClassPacket } image
} ifelse
} bind def
/GrayDirectClassPacket
{
%
% Get a DirectClass packet; convert to grayscale.
%
% Parameters:
% red
% green
% blue
% length: number of pixels minus one of this color (optional).
%
currentfile color_packet readhexstring pop pop
color_packet 0 get 0.299 mul
color_packet 1 get 0.587 mul add
color_packet 2 get 0.114 mul add
cvi
/gray_packet exch def
compression 0 eq
{
/number_pixels 1 def
}
{
currentfile byte readhexstring pop 0 get
/number_pixels exch 1 add def
} ifelse
0 1 number_pixels 1 sub
{
pixels exch gray_packet put
} for
pixels 0 number_pixels getinterval
} bind def
/GrayPseudoClassPacket
{
%
% Get a PseudoClass packet; convert to grayscale.
%
% Parameters:
% index: index into the colormap.
% length: number of pixels minus one of this color (optional).
%
currentfile byte readhexstring pop 0 get
/offset exch 3 mul def
/color_packet colormap offset 3 getinterval def
color_packet 0 get 0.299 mul
color_packet 1 get 0.587 mul add
color_packet 2 get 0.114 mul add
cvi
/gray_packet exch def
compression 0 eq
{
/number_pixels 1 def
}
{
currentfile byte readhexstring pop 0 get
/number_pixels exch 1 add def
} ifelse
0 1 number_pixels 1 sub
{
pixels exch gray_packet put
} for
pixels 0 number_pixels getinterval
} bind def
/PseudoClassPacket
{
%
% Get a PseudoClass packet.
%
% Parameters:
% index: index into the colormap.
% length: number of pixels minus one of this color (optional).
%
currentfile byte readhexstring pop 0 get
/offset exch 3 mul def
/color_packet colormap offset 3 getinterval def
compression 0 eq
{
/number_pixels 3 def
}
{
currentfile byte readhexstring pop 0 get
/number_pixels exch 1 add 3 mul def
} ifelse
0 3 number_pixels 1 sub
{
pixels exch color_packet putinterval
} for
pixels 0 number_pixels getinterval
} bind def
/PseudoClassImage
{
%
% Display a PseudoClass image.
%
% Parameters:
% class: 0-PseudoClass or 1-Grayscale.
%
currentfile buffer readline pop
token pop /class exch def pop
class 0 gt
{
currentfile buffer readline pop
token pop /depth exch def pop
/grays columns 8 add depth sub depth mul 8 idiv string def
columns rows depth
[
columns 0 0
rows neg 0 rows
]
{ currentfile grays readhexstring pop } image
}
{
%
% Parameters:
% colors: number of colors in the colormap.
% colormap: red, green, blue color packets.
%
currentfile buffer readline pop
token pop /colors exch def pop
/colors colors 3 mul def
/colormap colors string def
currentfile colormap readhexstring pop pop
systemdict /colorimage known
{
columns rows 8
[
columns 0 0
rows neg 0 rows
]
{ PseudoClassPacket } false 3 colorimage
}
{
%
% No colorimage operator; convert to grayscale.
%
columns rows 8
[
columns 0 0
rows neg 0 rows
]
{ GrayPseudoClassPacket } image
} ifelse
} ifelse
} bind def
/DisplayImage
{
%
% Display a DirectClass or PseudoClass image.
%
% Parameters:
% x & y translation.
% x & y scale.
% label pointsize.
% image label.
% image columns & rows.
% class: 0-DirectClass or 1-PseudoClass.
% compression: 0-none or 1-RunlengthEncoded.
% hex color packets.
%
gsave
/buffer 512 string def
/byte 1 string def
/color_packet 3 string def
/pixels 768 string def
currentfile buffer readline pop
token pop /x exch def
token pop /y exch def pop
x y translate
currentfile buffer readline pop
token pop /x exch def
token pop /y exch def pop
currentfile buffer readline pop
token pop /pointsize exch def pop
/Times-Roman findfont pointsize scalefont setfont
x y scale
currentfile buffer readline pop
token pop /columns exch def
token pop /rows exch def pop
currentfile buffer readline pop
token pop /class exch def pop
currentfile buffer readline pop
token pop /compression exch def pop
class 0 gt { PseudoClassImage } { DirectClassImage } ifelse
grestore
showpage
} bind def
%%EndProlog
%%Page: 1 1
%%PageBoundingBox: 19 17 576 822
DisplayImage
19 17
557 805
12
2314 3346
1
1
1
1
000000000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000071BBAC7F7
FFC7FFFFC77FFF47FDFD87BEFFC7FBFFC7FFFDC7F7FFC7FFFFC77F7FC7FFFFC7FFF6C7CFFFC7FF
7FC7FFFF87FFFFC7FFFFC7FFFFC7FFFFC7FFFFC7FFFFC7FFFFC7FFFFC7FFFFC7FFFFC7FFFFC7FF
FFC7FFFFC7FFFFC7FFFFC7FFFFC7FFFFC7FFFFC7FFFFC7FFFFC7FFFBC7FFFFC7FFFFC7FFFFC7FF
FFC7FFFF87FFF847FEAB87AFEB87AEAAC7FFFFC7FFFDC7FF5FC7FFEFC7FBFFC7CF7AC7BEEF87FB
B44745144745144753FFC7FBFFC7FFFF47FFDAC7BEFB87F945075145075145073FFE47EDA7C750
288781D647226C47508DC7F52F47A112072F9147A28587A91FC735554776C4C7F97D8788CE8727
76C7DC4C872543C7822987B6ED476E3907D068875E1FC715B487DBC5072F5787465AC7E051874F
86C7D25D07E04F07823687000716A687AA53872B50475158C78F0347BB28C793C287EE9B8760F1
C7CEDC07C591079277C7FB83C7C32D07020B87410987D07447302B8726F7878DAAC7B1F2471C1B
878C0987F80A87A375C7493F8735E9879B7687370CC7A8DB0792EC4778FA4755E3079F330718EA
8799CF87F3CA87827F879F6FC7ED9107AE0AC7E17387F35E87036387D2C587DABD47DBDAC7B5B6
C73313076466C7CA6EC79A6B87E97F473AFBC787EEC7E353479E3847FD0B877C1F472181879EA9
0725A5871F1CC76F68879AE887196D072F2F87AAE807B3DA87FEFBC754B5C74354C7C6EF87F208
C738A64764B787FFCB8711E807E6CCC7C2B8C796530705044711F0076265872F0B47E732875E69
87843507CB210737B48772B207571287957487AE74479DA587DD240700075981C7793787FC9107
E3B2C7BC5D472B2B07506F87DC93C766F8078F9007FA7E87B81A0757514716A107558907F2D207
7CCD479181472FFE4794D187855AC75F20074C0047AF9C878ACE07017907954387D0B38745BE47
195747BFA0470FE487AD3A87166F47D3C187F1AEC7EF7F87863BC75ABAC7C3C6C7E83AC7A80EC7
0A300793BAC7C59D47A6C08730F8472E9B87DC2A8728FA8779DFC7131C072061C7D9FB075E1447
98760757A7872546471E4287520B47CACF0769F587C38DC7CAF707950D07842D07017807A2B907
F19307396BC787EC473DB0071054878E7D871786872F16C796A98748A107A5C407F678C7D79607
D77987535107045987659487B382C73B74076EB20702B5C744AE474EB207062C87ABBAC78ADF87
E7C987F06DC70038BEA078BA03F8A8D738D54EF83A24B8FAAA3827CFF826A738D936F86A0BF89F
#!/bin/sh
while [ $# -gt 0 ]; do
target=`echo "$1" | sed -e 's/\.pgm$/.ps/'`
echo Converting "$1" to "$target"
# We assume roughly 0.25 inch border (18) on each side.
# A4 is 595.27559 x 841.889763 (595 x 842)
# Letter is 8.5x11 inches or 612x792.
# Change to 556.56x807.12+19.22+17.44 for A4 and
# 573.84x755.28+19.08+18.36 for US Letter.
# Don't forget to change XCROSSES and YCROSSES in optar.h and
# recompile.
convert -resample 300x300 -density 300x300 -page 556.56x807.12+19.22+17.44 "$1" "$target"
# convert -page 573.84x755.28+19.08+18.36 "$1" "$target"
shift
done
a on je to vlastně jen ImageMagick. Ten tvoří ve výchozím nastavení 72DPI a je potřeba použít přepínač -resample aby bitmapový obrázek resamploval do požadovaného rozlišení. Zkusím tedy -resample 600x600, tisk a prozkoumám jestli mi ta tiskárna furt ditheruje kolem hran. Teď jen přijít na čem to resampluju protože i -resample 300x300 generuje velmi soloidní hovada a šestistovka mi zamrazí počítač
Tiskni
Sdílej:
ISSN 1214-1267, (c) 1999-2007 Stickfish s.r.o.