Re: large images / EPSI



In article <e2aup0$orq$1@xxxxxxxxxxxxxxxxxxxxxxxxx>,
Christian Gollwitzer <Christian.Gollwitzer@xxxxxxxxxxxxxxx> wrote:
blmblm@xxxxxxxxxxxxx wrote:
Example at http://www.cs.trinity.edu/~mlewis/Rings/vwinbow/.

The author of the program that produces these huge files says "it is
vector graphics with a WHOLE BUNCH of tiny rectangles"

This is an exceptionally stupid way to represent what is really a bitmap
as pseudo-vector graphics. Essentially every single pixel is drawn
with the sequence:

0.8206095 1.0 0.0 SC
N
-0.008003304 0.001298332 M
-0.0023513036 0.001298332 L
-0.0023513036 0.001301752 L
-0.008003304 0.001301752 L
-0.008003304 0.001298332 L
P
G
WC
WF
R N

which is otherwise represented in three(!) bytes in an ordinary
uncompressed format.
If you cannot modify the program that writes this bloat, you can write a
simple script in awk, perl or similiar that extracts the three numbers
before each SC, multiplies them with 255 (which gets you th rgb-Values)
and writes them to a raw stream. You then hav just to count the number
of columns and rows and can produce an equally (if not better) looking
bitmap, that should be smaller about 60 times.

That sounds promising, but ....

If I understand you correctly, it assumes that there is exactly one
of these "draw a tiny rectangle" sequences per pixel, and that they
are in some order. True?

If not, never mind, but if so -- I'm not sure this is the case. As I
understand it, the PostScript is being generated by Java library
code, which has been presented with an internal representation
consisting of a lot of tiny rectangles, which probably are in some
sensible order (though I wouldn't want to bet on that without knowing
more), but which do not necessarily map one-to-one onto pixels.
In fact, if I understand the author of the code correctly, there can
be more rectangles than pixels; the rationale for this is that it
avoids the potential for "sampling problems".

--
| B. L. Massingill
| ObDisclaimer: I don't speak for my employers; they return the favor.
.



Relevant Pages

  • Re: Vector Graphics - was MFC and GDI+
    ... one of the page description interpreted languages which use the underlying ... getting a rounding error such that one line is 1 pixel out from where it ... would be true with vector graphics. ... So for now I'll stick to asking for the printer resolution, ...
    (microsoft.public.vc.mfc)
  • Re: Bitmap collision detection in VB6
    ... rectangles calculation - simple enough, ... sprite collision detection, and it is *very fast* in a compiled exe ... does contain a black pixel then the actual sprite pixels are touching, ... bmp file. ...
    (comp.lang.basic.visual.misc)
  • Re: Vector Graphics - was MFC and GDI+
    ... The solution is to use a music font; ... which can end up being either one pixel or two pixels wide depending on the layout. ... Vector GRAPHICS representations of musical symbols don't work well because the mappings to ... Nowadays printers generally gave a better resolution, ...
    (microsoft.public.vc.mfc)
  • Re: Newbie read image help
    ... First, the data will come with a header, possibly of a variable size. ... That's why a 2-million pixel photo does not occupy ... Pack the rectangles on top of each other, read the bits in the same ... you try to write an image file reader from scratch. ...
    (comp.lang.cpp)
  • Re: Graphics2D: g2d.fill(rect) and g2D.draw(rect) dont show at same coordinates when used with use
    ... You see 3 rows of rectangles: first have a borderLine> 1 pixel, ... public static void main ...
    (comp.lang.java.gui)