Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SVG Scaling Improvements (especially if scaling SVG larger than Timeline) #622

Merged
merged 2 commits into from
Jan 28, 2021

Conversation

jonoomph
Copy link
Member

Fixing a big issue where SVG files are not correctly scaled to larger resolutions, for cases where the default size is smaller than the Timeline size (or preview size). Now SVG files are rescaled/re-rasterized larger when needed, and otherwise cached.

Before this fix, for example, an emoji (default size 71x71) would be loaded, and upscaled to the preview window size... and was blurry. Now, it is re-rasterized to get an HD sharp image, so the emoji is much prettier.

… resolutions, for cases where the default size is smaller than the Timeline size (or preview size). Now SVG files are rescaled/re-rasterized larger when needed, and otherwise cached.
@jonoomph jonoomph changed the title SVG Scaling Improvements (especially when scaling SVG files larger than the Timeline) SVG Scaling Improvements (especially if scaling SVG larger than Timeline) Jan 28, 2021
@codecov
Copy link

codecov bot commented Jan 28, 2021

Codecov Report

Merging #622 (3bbd972) into develop (cb816e1) will increase coverage by 0.25%.
The diff coverage is 85.39%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop     #622      +/-   ##
===========================================
+ Coverage    52.54%   52.80%   +0.25%     
===========================================
  Files          129      130       +1     
  Lines        10827    10880      +53     
===========================================
+ Hits          5689     5745      +56     
+ Misses        5138     5135       -3     
Impacted Files Coverage Δ
src/QtImageReader.h 66.66% <ø> (ø)
src/QtImageReader.cpp 73.77% <75.92%> (+7.42%) ⬆️
tests/QtImageReader_Tests.cpp 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update cb816e1...71c6c23. Read the comment docs.

@jeffski
Copy link
Contributor

jeffski commented Jan 28, 2021

Is it possible to do this for text based readers too (QtText, QtHTML and TextReader)? I've noticed that these are drawn at the original size but then if you apply a keyframe animation to scale the text bigger, over time, the text/image gets blurry as they are scaled. I presume the original size image of the text is used and scaled rather than redrawing on each frame.

Not sure if that is possible or if it would be slow to render but it would make the text a lot sharper on each frame.

@jonoomph
Copy link
Member Author

Sure, this can be done on all the Readers... but SVG was really noticeable, lol.

@jonoomph jonoomph merged commit 9743b1c into develop Jan 28, 2021
@jonoomph jonoomph deleted the svg_rescaling_hd branch January 28, 2021 22:14
@jeffski
Copy link
Contributor

jeffski commented Jan 28, 2021

It would be great upgrade if you could do it!! I can see how stretching that emoji would look pretty bad.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants