unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Background color in SVG display
@ 2022-06-23  6:42 Pascal Quesseveur
  2022-06-23  7:01 ` Eli Zaretskii
  0 siblings, 1 reply; 11+ messages in thread
From: Pascal Quesseveur @ 2022-06-23  6:42 UTC (permalink / raw)
  To: help-gnu-emacs

Hello,

The way SVG files are displayed has changed with emacs 28: the
background is now displayed with a color that looks like coral4. Where
does this color come form and how to change it?

I use Windows compiled binaries from GNU.

system-configuration is "x86_64-w64-mingw32"

system-configuration-options is "--with-modules --without-dbus
--with-native-compilation --without-compress-install CFLAGS=-O2"

system-configuration-features is "ACL GIF GMP GNUTLS HARFBUZZ JPEG
JSON LCMS2 LIBXML2 MODULES NATIVE_COMP NOTIFY W32NOTIFY PDUMPER PNG
RSVG SOUND THREADS TIFF TOOLKIT_SCROLL_BARS XPM ZLIB"


-- 
Pascal Quesseveur
pquessev@gmail.com




^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Background color in SVG display
  2022-06-23  6:42 Background color in SVG display Pascal Quesseveur
@ 2022-06-23  7:01 ` Eli Zaretskii
  2022-06-23 10:35   ` Pascal Quesseveur
  0 siblings, 1 reply; 11+ messages in thread
From: Eli Zaretskii @ 2022-06-23  7:01 UTC (permalink / raw)
  To: help-gnu-emacs

> From: Pascal Quesseveur <pquessev@gmail.com>
> Date: Thu, 23 Jun 2022 08:42:53 +0200
> 
> The way SVG files are displayed has changed with emacs 28: the
> background is now displayed with a color that looks like coral4. Where
> does this color come form and how to change it?

How do you see that background?  Please show a recipe, starting from
"emacs -Q", that reproduces such a display of an SVG image.  If this
happens only with some SVG images, please attach that image as well.

FWIW, in some naïve attempt to reproduce this ("emacs -Q", then visit
splash.svg from the Emacs tree) failed to show any such background
color; I see the default background color of the frame.



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Background color in SVG display
  2022-06-23  7:01 ` Eli Zaretskii
@ 2022-06-23 10:35   ` Pascal Quesseveur
  2022-06-23 10:45     ` Eli Zaretskii
  0 siblings, 1 reply; 11+ messages in thread
From: Pascal Quesseveur @ 2022-06-23 10:35 UTC (permalink / raw)
  To: help-gnu-emacs

>"EZ" == Eli Zaretskii <eliz@gnu.org> writes:

  EZ> How do you see that background?  Please show a recipe, starting
  EZ> from "emacs -Q", that reproduces such a display of an SVG image.

I finally managed to define a minimal test:

runemacs -Q \
 --eval="(setq initial-frame-alist (list (cons 'background-color \"azure\")))"

then visit splash.svg

The background color depends on the frame background color. It is
light orange in this case.


-- 
Pascal Quesseveur
pquessev@gmail.com




^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Background color in SVG display
  2022-06-23 10:35   ` Pascal Quesseveur
@ 2022-06-23 10:45     ` Eli Zaretskii
  2022-06-23 10:50       ` Pascal Quesseveur
  2022-06-23 12:17       ` Pascal Quesseveur
  0 siblings, 2 replies; 11+ messages in thread
From: Eli Zaretskii @ 2022-06-23 10:45 UTC (permalink / raw)
  To: help-gnu-emacs

> From: Pascal Quesseveur <pquessev@gmail.com>
> Date: Thu, 23 Jun 2022 12:35:25 +0200
> 
> >"EZ" == Eli Zaretskii <eliz@gnu.org> writes:
> 
>   EZ> How do you see that background?  Please show a recipe, starting
>   EZ> from "emacs -Q", that reproduces such a display of an SVG image.
> 
> I finally managed to define a minimal test:
> 
> runemacs -Q \
>  --eval="(setq initial-frame-alist (list (cons 'background-color \"azure\")))"
> 
> then visit splash.svg
> 
> The background color depends on the frame background color. It is
> light orange in this case.

I think it's your eyes that play illusion games with you.  Start
"emacs -Q" with no other arguments and move the frame of that second
Emacs near the one with splash.svg: you will see that the background
of the image is white, like the one in the second Emacs.

What happens here is that the contrast between the azure background of
the frame and the white background of the SVG image causes you to
perceive the white color as the reverse of the azure one, which is
pale red.



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Background color in SVG display
  2022-06-23 10:45     ` Eli Zaretskii
@ 2022-06-23 10:50       ` Pascal Quesseveur
  2022-06-23 12:17       ` Pascal Quesseveur
  1 sibling, 0 replies; 11+ messages in thread
From: Pascal Quesseveur @ 2022-06-23 10:50 UTC (permalink / raw)
  To: help-gnu-emacs

>"EZ" == Eli Zaretskii <eliz@gnu.org> writes:

  EZ> "emacs -Q" with no other arguments and move the frame of that second
  EZ> Emacs near the one with splash.svg: you will see that the background
  EZ> of the image is white, like the one in the second Emacs.

Even with a darker background, like royalblue4?


-- 
Pascal Quesseveur
pquessev@gmail.com




^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Background color in SVG display
  2022-06-23 10:45     ` Eli Zaretskii
  2022-06-23 10:50       ` Pascal Quesseveur
@ 2022-06-23 12:17       ` Pascal Quesseveur
  2022-06-23 13:04         ` Eli Zaretskii
  1 sibling, 1 reply; 11+ messages in thread
From: Pascal Quesseveur @ 2022-06-23 12:17 UTC (permalink / raw)
  To: help-gnu-emacs

>"EZ" == Eli Zaretskii <eliz@gnu.org> writes:

  EZ> Emacs near the one with splash.svg: you will see that the background
  EZ> of the image is white, like the one in the second Emacs.

  I thought it would be the frame background, azure in that
case. Anyway when I try with a SVG file without background I don't see
the frame background. And it works with emacs 27.1.


-- 
Pascal Quesseveur
pquessev@gmail.com




^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Background color in SVG display
  2022-06-23 12:17       ` Pascal Quesseveur
@ 2022-06-23 13:04         ` Eli Zaretskii
  2022-06-23 15:43           ` Pascal Quesseveur
  0 siblings, 1 reply; 11+ messages in thread
From: Eli Zaretskii @ 2022-06-23 13:04 UTC (permalink / raw)
  To: help-gnu-emacs

> From: Pascal Quesseveur <pquessev@gmail.com>
> Date: Thu, 23 Jun 2022 14:17:19 +0200
> 
> >"EZ" == Eli Zaretskii <eliz@gnu.org> writes:
> 
>   EZ> Emacs near the one with splash.svg: you will see that the background
>   EZ> of the image is white, like the one in the second Emacs.
> 
>   I thought it would be the frame background, azure in that
> case. Anyway when I try with a SVG file without background I don't see
> the frame background. And it works with emacs 27.1.

We did make changes in how SVG images are handled wrt their
background, so if you think the new behavior is a bug, feel free to
submit an Emacs bug report.  (Your version of librsvg also matters.)



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Background color in SVG display
  2022-06-23 13:04         ` Eli Zaretskii
@ 2022-06-23 15:43           ` Pascal Quesseveur
  2022-06-23 16:06             ` Eli Zaretskii
  0 siblings, 1 reply; 11+ messages in thread
From: Pascal Quesseveur @ 2022-06-23 15:43 UTC (permalink / raw)
  To: help-gnu-emacs

>"EZ" == Eli Zaretskii <eliz@gnu.org> writes:

  EZ> We did make changes in how SVG images are handled wrt their
  EZ> background, so if you think the new behavior is a bug, feel free
  EZ> to submit an Emacs bug report.  (Your version of librsvg also
  EZ> matters.)

  As I said I use windows version compiled from GNU. librsvg is
version 2.2.

  I didn't say there was a bug. I was wondering if this was the
expected behavior and if there was a way to change this color. I think
I've read that the background color could be set with the font's
background color, but if that's the case, that clearly doesn't work
for me.


-- 
Pascal Quesseveur
pquessev@gmail.com




^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Background color in SVG display
  2022-06-23 15:43           ` Pascal Quesseveur
@ 2022-06-23 16:06             ` Eli Zaretskii
  2022-06-23 18:14               ` Pascal Quesseveur
  0 siblings, 1 reply; 11+ messages in thread
From: Eli Zaretskii @ 2022-06-23 16:06 UTC (permalink / raw)
  To: help-gnu-emacs

> From: Pascal Quesseveur <pquessev@gmail.com>
> Date: Thu, 23 Jun 2022 17:43:01 +0200
> 
> >"EZ" == Eli Zaretskii <eliz@gnu.org> writes:
> 
>   EZ> We did make changes in how SVG images are handled wrt their
>   EZ> background, so if you think the new behavior is a bug, feel free
>   EZ> to submit an Emacs bug report.  (Your version of librsvg also
>   EZ> matters.)
> 
>   As I said I use windows version compiled from GNU. librsvg is
> version 2.2.

2.2?  Are you sure?  That sounds very old.  The latest stable version
is 2.56, AFAIK.

>   I didn't say there was a bug. I was wondering if this was the
> expected behavior and if there was a way to change this color. I think

I cannot reproduce the problems you describe, but I'm not the expert
on displaying SVG images.  If you report a bug, it will be looked at
by people who are experts.  There's no need to worry about reporting a
bug which eventually turns out not to be a bug.

> I've read that the background color could be set with the font's
> background color, but if that's the case, that clearly doesn't work
> for me.

AFAIU, in Emacs 28 and later you should be able to give a face text
property to the part of the buffer that displays SVG image(s), and the
background color of that face will be honored by the SVG display,
provided that (a) your librsvg is recent enough, and (b) the SVG image
itself doesn't specify a background color.



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Background color in SVG display
  2022-06-23 16:06             ` Eli Zaretskii
@ 2022-06-23 18:14               ` Pascal Quesseveur
  2022-06-23 18:40                 ` Eli Zaretskii
  0 siblings, 1 reply; 11+ messages in thread
From: Pascal Quesseveur @ 2022-06-23 18:14 UTC (permalink / raw)
  To: help-gnu-emacs

>"EZ" == Eli Zaretskii <eliz@gnu.org> writes:

  EZ> 2.2?  Are you sure?  That sounds very old.  The latest stable
  EZ> version is 2.56, AFAIK.

  No I am not sure. As librsvg is named librsvg-2-2.dll I supposed
it should be 2.2. But I looked in emacs 27.1 directory and librsvg is also
librsvg-2.2.dll but the size is different. As version 27.1 was correct
I copied librsvg from 27.1 to 28.1: display is always wrong in 28.1 so
I suppose libsrvg is not the culprit.

  EZ> I cannot reproduce the problems you describe, but I'm not the
  EZ> expert on displaying SVG images.  If you report a bug, it will
  EZ> be looked at by people who are experts.  There's no need to
  EZ> worry about reporting a bug which eventually turns out not to be
  EZ> a bug.

  I know that but I'd rather be sure I understood the problem.
  
  EZ> AFAIU, in Emacs 28 and later you should be able to give a face
  EZ> text property to the part of the buffer that displays SVG
  EZ> image(s), and the background color of that face will be honored
  EZ> by the SVG display, provided that (a) your librsvg is recent
  EZ> enough, and (b) the SVG image itself doesn't specify a
  EZ> background color.

  splash.svg has no background. I have decided to advise create-image
to set explictely image background color attribute:

(setq image (nconc image (list :background color)))

  When color is a variant of grey, display seems ok. When it is
#ff0000 background of displayed image is blue. And when #0000ff image
background is red. When I set color attribute to #904020 I get a
displayed color more or less similar to royalblue4 (#1a2f79).


-- 
Pascal Quesseveur
pquessev@gmail.com




^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Background color in SVG display
  2022-06-23 18:14               ` Pascal Quesseveur
@ 2022-06-23 18:40                 ` Eli Zaretskii
  0 siblings, 0 replies; 11+ messages in thread
From: Eli Zaretskii @ 2022-06-23 18:40 UTC (permalink / raw)
  To: help-gnu-emacs

> From: Pascal Quesseveur <pquessev@gmail.com>
> Date: Thu, 23 Jun 2022 20:14:10 +0200
> 
> >"EZ" == Eli Zaretskii <eliz@gnu.org> writes:
> 
>   EZ> 2.2?  Are you sure?  That sounds very old.  The latest stable
>   EZ> version is 2.56, AFAIK.
> 
>   No I am not sure. As librsvg is named librsvg-2-2.dll I supposed
> it should be 2.2.

No, that's the version of the ABI, not of the library.



^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2022-06-23 18:40 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-06-23  6:42 Background color in SVG display Pascal Quesseveur
2022-06-23  7:01 ` Eli Zaretskii
2022-06-23 10:35   ` Pascal Quesseveur
2022-06-23 10:45     ` Eli Zaretskii
2022-06-23 10:50       ` Pascal Quesseveur
2022-06-23 12:17       ` Pascal Quesseveur
2022-06-23 13:04         ` Eli Zaretskii
2022-06-23 15:43           ` Pascal Quesseveur
2022-06-23 16:06             ` Eli Zaretskii
2022-06-23 18:14               ` Pascal Quesseveur
2022-06-23 18:40                 ` Eli Zaretskii

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).