[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[CVS] :mask property on images imprecise on GNU/Linux
From: |
Oliver Scholz |
Subject: |
[CVS] :mask property on images imprecise on GNU/Linux |
Date: |
Tue, 25 Feb 2003 16:01:03 +0100 |
User-agent: |
Gnus/5.090016 (Oort Gnus v0.16) Emacs/21.3.50 |
>From the Emacs Lisp Reference Manual:
,----[ Display => Images => Image Descriptors ]
| `:mask MASK'
| If MASK is `heuristic' or `(heuristic BG)', build a clipping mask
| for the image, so that the background of a frame is visible behind
| the image. If BG is not specified, or if BG is `t', determine the
| background color of the image by looking at the four corners of
| the image, assuming the most frequently occurring color from the
| corners is the background color of the image. Otherwise, BG must
| be a list `(RED GREEN BLUE)' specifying the color to assume for
| the background of the image.
`----
Unfortunately this is rather imprecise on a GNU/Linux system (tested
with Debian Woody):
If I take an example PPM image like this:
(setq my-test-ppm
(concat "P6 8 8 255 "
[0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1
0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1
0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1
0 0 1 0 0 0 0 0 0 255 255 255 255 255 255 0 0 0 0 0 0 0 0 1
0 0 1 0 0 0 0 0 0 255 255 255 255 255 255 0 0 0 0 0 0 0 0 1
0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1
0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1
0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1]))
Then the following should -- after evaluation -- insert a hollow black
(#000001) square with a tiny white (#FFFFFF) dot in the middle. The
area between the black lines of the square and the white dot should be
transparent.
(insert-image (create-image my-test-ppm 'pbm t :mask '(heuristic (0 0 0))))
On GNU/Linux, however, this appears as a tiny white dot only, nothing
else. As far as the :mask property is concerned, Emacs treats the
colours #000000 and #000001 as the same. This is bad. Emacs should
recognize *especially* the colour used to specify transparent areas
very precisely.
Ironically this works correctly on MS Windows XP.
FYI, it works correctly on GNU/Linux only when the difference between
the colours is big enough. For example, if I define the PPM above in
the following way, it is o.k.:
(setq my-test-ppm
(concat "P6 8 8 255 "
[0 0 5 0 0 5 0 0 5 0 0 5 0 0 5 0 0 5 0 0 5 0 0 5
0 0 5 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 5
0 0 5 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 5
0 0 5 0 0 0 0 0 0 255 255 255 255 255 255 0 0 0 0 0 0 0 0 5
0 0 5 0 0 0 0 0 0 255 255 255 255 255 255 0 0 0 0 0 0 0 0 5
0 0 5 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 5
0 0 5 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 5
0 0 5 0 0 5 0 0 5 0 0 5 0 0 5 0 0 5 0 0 5 0 0 5]))
Oliver
--
Oliver Scholz 7 Ventôse an 211 de la Révolution
Taunusstr. 25 Liberté, Egalité, Fraternité!
60329 Frankfurt a. M. http://www.jungdemokratenhessen.de
Tel. (069) 97 40 99 42 http://www.jdjl.org
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [CVS] :mask property on images imprecise on GNU/Linux,
Oliver Scholz <=