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

Add image format options to reduce code bloat #376

Closed
valpackett opened this issue May 31, 2020 · 1 comment · Fixed by #392
Closed

Add image format options to reduce code bloat #376

valpackett opened this issue May 31, 2020 · 1 comment · Fixed by #392
Labels
feature New feature or request good first issue Good for newcomers improvement An internal improvement
Milestone

Comments

@valpackett
Copy link
Contributor

valpackett commented May 31, 2020

The image crate with default options is the absolute leader in code size:

 File  .text     Size Crate
 5.7%  14.6% 364.0KiB image
 4.6%  12.0% 297.3KiB wgpu_native
 3.8%   9.9% 246.5KiB std
 3.5%   8.9% 222.1KiB usvg
 2.6%   6.8% 170.0KiB iced_wgpu

I don't need to support ico, bmp, tga, hdr, dxt, dds, farbfeld and so on in a program that would only ever decode PNGs :)

It's pretty straightforward to add

[features]
png = ["image/png"]
# and so on

but for backwards compat, the image feature would have to enable some reasonable default set of formats.

Looks like this can be accomplished using cargo's dependency rename thing (e.g. image = { … package = "image_rs" }). What do you think?


Ideally, there should be an option to not use image at all and just provide raw pixel data. (And with explicit gpu memory management instead of a magical cache :D)

@hecrj hecrj added feature New feature or request improvement An internal improvement labels Jun 1, 2020
@hecrj hecrj added this to the 0.2.0 milestone Jun 1, 2020
@hecrj
Copy link
Member

hecrj commented Jun 1, 2020

[...] What do you think?

Sounds good!

Ideally, there should be an option to not use image at all and just provide raw pixel data. (And with explicit gpu memory management instead of a magical cache :D)

We will eventually move Image and Svg to iced_graphics. Exposing internals of specific renderers is also something I have in mind, as it will help with some use cases discussed in #32. We are not ready to write code for this yet, however!

@hecrj hecrj added the good first issue Good for newcomers label Jun 2, 2020
valpackett added a commit to valpackett/iced that referenced this issue Jun 5, 2020
valpackett added a commit to valpackett/iced that referenced this issue Jun 9, 2020
valpackett added a commit to valpackett/iced that referenced this issue Jun 13, 2020
valpackett added a commit to valpackett/iced that referenced this issue Jul 19, 2020
valpackett added a commit to valpackett/iced that referenced this issue Jul 19, 2020
valpackett added a commit to valpackett/iced that referenced this issue Aug 26, 2020
valpackett added a commit to valpackett/iced that referenced this issue Sep 9, 2020
valpackett added a commit to valpackett/iced that referenced this issue Oct 18, 2020
valpackett added a commit to valpackett/iced that referenced this issue Nov 7, 2020
valpackett added a commit to valpackett/iced that referenced this issue Nov 10, 2020
valpackett added a commit to valpackett/iced that referenced this issue Nov 13, 2020
valpackett added a commit to valpackett/iced that referenced this issue Nov 20, 2020
valpackett added a commit to valpackett/iced that referenced this issue Nov 20, 2020
valpackett added a commit to valpackett/iced that referenced this issue Nov 20, 2020
valpackett added a commit to valpackett/iced that referenced this issue Nov 23, 2020
valpackett added a commit to valpackett/iced that referenced this issue Nov 24, 2020
valpackett added a commit to valpackett/iced that referenced this issue Nov 25, 2020
valpackett added a commit to valpackett/iced that referenced this issue Nov 25, 2020
@hecrj hecrj modified the milestones: 0.2.0, 0.3.0 Nov 26, 2020
valpackett added a commit to valpackett/iced that referenced this issue Feb 13, 2021
hecrj pushed a commit to valpackett/iced that referenced this issue Feb 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request good first issue Good for newcomers improvement An internal improvement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants