Canvas color option

Bug #169623 reported by William Swanson
114
This bug affects 20 people
Affects Status Importance Assigned to Milestone
Inkscape
Fix Released
Wishlist
William Swanson

Bug Description

When a user's document contains a transparent
background color, Inkscape currently defaults to a
white canvas. This patch creates a new option, allowing
the user to change the Inkscape canvas from white to
some other color.

Tags: color renderer ui
Revision history for this message
William Swanson (swansontec) wrote :
Revision history for this message
Buliabyak-users (buliabyak-users) wrote :

I'm afraid having both "canvas" and "background" in the same
dialog will be very confusing for the users. Can you at
least make it so that the canvas color selector is disabled
(grayed out) unless the background color has transparency?

Revision history for this message
William Swanson (swansontec) wrote :

Done. Setting the page background fully opaque disables the
canvas color.

Revision history for this message
William Swanson (swansontec) wrote : Disables canvas color selector when page is opaque

Other attachments

Revision history for this message
William Swanson (swansontec) wrote :

It may be better to hold this off until after 0.44. The
implementation seems half-baked, since the canvas color
still has a transparency slider. This is meaningless at best
and confusing at worst. A better implementation would either
remove the transparency slider from the canvas color dialog
or do something useful with it, like display a checkerboard
under a transparent canvas color.

Revision history for this message
Bryce Harrington (bryce) wrote :

If this is still valid, this patch should be reviewed for inclusion into 0.46

Changed in inkscape:
importance: Undecided → Medium
milestone: none → 0.46
Revision history for this message
William Swanson (swansontec) wrote :

I am working on a new version of the patch, which will address the issues I mentioned earlier and remove the accumulated bit-rot. The new patch should be ready for inclusion into 0.46.

Revision history for this message
Bryce Harrington (bryce) wrote :

Hi William,

How is the patch coming along? We're at the point where everything for 0.46 needs to be in SVN, so if you have the patch ready to go, please let us know; otherwise we wait and get it in for 0.47.

Revision history for this message
William Swanson (swansontec) wrote :

I ran into some snags, and the patch is not ready. This will have to be postponed to the next version. Sorry about that.

Revision history for this message
Bryce Harrington (bryce) wrote :

No prob, thanks for getting back to me. We'll look forward to it for 0.47.

Revision history for this message
Bryce Harrington (bryce) wrote :

Removing milestone; this will be worked on for 0.47.

Changed in inkscape:
milestone: 0.46 → none
Revision history for this message
ScislaC (scislac) wrote :

William,

It's been a while, is this something you are still working on?

Revision history for this message
William Swanson (swansontec) wrote :

Here is an updated patch which is no longer bit-rotted. I am not happy with the implementation, though. In a perfect world, the canvas color would actually be a checkerboard of two colors, like the GIMP or any other program has. Falling short of that, it should certainly not have an opacity setting like it has here. The canvas is the bottom-most thing in the drawing, so an opacity setting makes no sense.

To fix this, I will create another patch which introduces a RegisterdColorPicker without opacity sliders. That will allow the canvas color to be fully opaque.

Revision history for this message
William Swanson (swansontec) wrote : Re: [Bug 169623] Re: Canvas color option

Hello,
Thanks for emailing me. I completely forgot about that old patch.

I was able to spend a few hours this afternoon updating the patch and removing the bit-rot. It should now apply cleanly to the trunk. As I mentioned in the bug report, though, I'm still not 100% happy with the implementation, and will hopefully have another patch this evening.

-William Swanson

----- Original Message ----
> From: ScislaC <email address hidden>
> To: <email address hidden>
> Sent: Thursday, May 7, 2009 1:23:09 PM
> Subject: [Bug 169623] Re: Canvas color option
>
> William,
>
> It's been a while, is this something you are still working on?
>
> --
> Canvas color option
> https://bugs.launchpad.net/bugs/169623
> You received this bug notification because you are a direct subscriber
> of the bug.

Revision history for this message
Equis (rob-cummingsonline) wrote :

I'm glad to see this has some active development. We just had a conversation in the #inkscape IRC channel regarding the background and how it displays white even when it's transparent. I would change the background color so that transparent objects are easier to see, but I also noticed that an export also retains the workspace background color. If I want items on a colored (or even white) background, wouldn't it make more sense to put a rectangle behind them and assume that the intent of lack of objects is transparent no matter what? That is, if I didn't put it there, there should be *anything* there, right? Could this issue be resolved as easily as including a "print or export background" checkbox in the preferences or print/export dialogs to indicate whether or not it should be included in the output?

Thanks to the devs for all their hard work!

tags: added: color renderer
Revision history for this message
jazzynico (jazzynico) wrote :

Hi William,
Are you still working on this patch?
I've just tested it and it works nicely, but as you wrote, the opacity setting make no sense, and it would be nice if you could remove it.

Changed in inkscape:
importance: Medium → Wishlist
Revision history for this message
William Swanson (swansontec) wrote :

Here is a different approach to the problem, inspired by the comment from Equis. Rather than add a new control for window color, this patch simply sets the window color to the drawing background color, ignoring alpha. In other words, setting the drawing's background color to #00000000 (fully transparent black) will cause the drawing window to have a black background rather than white as before. Export is not affected, however, so the final .png file will still be fully transparent. If someone could review and commit this, that would be great!

Revision history for this message
qubodup (qubodup) wrote :

This is a solution that would do it for me, but it is lacking and might be a problem for others: even when an image is fully transparent, the RGB values are of relevance sometimes, for example in systems that cannot render images with non-full-opacity.

Revision history for this message
William Swanson (swansontec) wrote :

> even when an image is fully transparent, the RGB values are of relevance sometimes

I agree, but I think this solution works for your case too. After all, if an image is intended for a blue background, it makes sense to have both a blue editing environment as well as a blue RGB for the transparent pixels. This change accomplishes the first without impacting the ability to do the second.

Revision history for this message
qubodup (qubodup) wrote :

> After all, if an image is intended for a blue background, it makes sense to have both a blue editing environment as well as a blue RGB for the transparent pixels.
I can only think of cases where this is true. So I'm convinced now. :)

Revision history for this message
W. J. van der Laan (laanwj) wrote :

I'd love to see this feature, it has always frustrated me that I had to set the background opactity to 100% to actually see my SVG that is meant for grey or black background in the GUI as it should be.

Revision history for this message
Nathan Broadbent (nathan-f77) wrote :

Seriously??? It's been FIVE YEARS and this isn't closed yet?!?!?! I've just been googling like a maniac trying to figure out how to change the default background color. I'm new to Inkscape, and I just want to do some simple white titles for a video presentation. I have to do about 30 titles, and there's no way I'm going to keep changing the background opacity back and forth.

As I myself contribute to and maintain open source software, I strongly feel that FIVE YEARS is a long freaking time for such a minuscule feature.

Please just accept William Swanson's patch!!!!
https://bugs.launchpad.net/inkscape/+bug/169623/+attachment/1185169/+files/CanvasColor4.patch

Revision history for this message
qubodup (qubodup) wrote :

+1...

Revision history for this message
Nathan Broadbent (nathan-f77) wrote :

I've compiled a patched version of Inkscape with this feature, and it's really, really useful.

There was a small conflict, so here's a 'rebased' version of the patch that applies cleanly: https://gist.github.com/1232291

Revision history for this message
Ed Kohlwey (ekohlwey-gmail) wrote :

+1

jazzynico (jazzynico)
Changed in inkscape:
assignee: nobody → JazzyNico (jazzynico)
milestone: none → 0.49
Revision history for this message
jazzynico (jazzynico) wrote :

Fix committed in the trunk, revision 10784.
Thanks a lot for your patch, William!

Changed in inkscape:
assignee: JazzyNico (jazzynico) → William Swanson (swansontec)
status: In Progress → Fix Committed
Revision history for this message
Tobias Bieniek (tobias-bieniek) wrote :

is this patch part of any official release yet?

Revision history for this message
jazzynico (jazzynico) wrote :

> is this patch part of any official release yet?

Not yet. It's part of Inkscape 0.49 which is still under development.

Bryce Harrington (bryce)
Changed in inkscape:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.