woelper / oculante

A fast and simple image viewer / editor for many operating systems
https://github.com/woelper/oculante
MIT License
794 stars 38 forks source link

SVG rendering quality control #373

Open Stoppedpuma opened 1 week ago

Stoppedpuma commented 1 week ago

Moved from https://github.com/woelper/oculante/issues/372#issuecomment-2183263797.

No idea how this would work, is the plan just to render based on scaled multiplication? E.g 2x or 5x resolution if specified?

Stoppedpuma commented 1 week ago

If I may ask, what is the reason behind not wanting to "completely support" SVGs? I'm assuming for performance reasons and to allow edits as you mentioned but can't think of anything else? I find not fully supporting SVGs quite odd as I think this is probably the only time I've seen this type of implementation.

woelper commented 1 week ago

Hi! I think this is a bit of a misquote. I said "I am not going to make this a complete svg renderer.", but I think it still makes sense to completely support SVG, The library I am using apparently has even better support than chrome, so you will be able to expect quite complete support for the SVG standard - likely better than other large projects have.

What I meant is that this is an image viewer, and I will render the SVGs to pixels. I am not going to make the app a SVG renderer which supports lossless scaling. This would require a massive amount of work.

A couple of ideas:

Right now, SVG files contain a resolution attribute which is used to render it.

Stoppedpuma commented 1 week ago

I just find it unusual to rasterise vectors I guess? Either way an option to control scaling is definitely an improvement!

When an SVG is loaded, display a quality / scaling slider

How does something like this look to you? Manual input should also be included in an implementation such as this.

image

woelper commented 1 week ago

It sounds a bit esoteric, but every SVG/Vector you see is rasterized in the end :) - I just chose to do that once at load. Having some kind of additional control seems good. I've also thought about a second "view" bar below the menu which could be used for things like that, but also other options such as PDF page navigation, manual animation stepping etc.

Stoppedpuma commented 1 week ago

I've also thought about a second "view" bar below the menu

There should be enough room to fill in some of the blankness of the bar at the top if that sounds interesting to you. I can throw something together real quick if you would like to see how it would look.

image

Stoppedpuma commented 1 week ago

I can throw something together real quick if you would like to see how it would look

Did it anyway because I've created a similar approach before which integrates quite well. Idea here is to slide down when a format has support for an additional feature such as PDF navigation or SVG scale. The empty room on the right is for if you have any ideas of what to put there.

bar-extension