8000 feature request: add basic image operations · Issue #139 · zigimg/zigimg · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

feature request: add basic image operations #139

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

Open
Flecart opened this issue Sep 20, 2023 · 7 comments
Open

feature request: add basic image operations #139

Flecart opened this issue Sep 20, 2023 · 7 comments

Comments

@Flecart
Copy link
Contributor
Flecart commented Sep 20, 2023

Add api's for every image type that do standard image operations like:

  1. crop
  2. flip horizontally vertically
  3. join with other image on the edges
  4. from color to grayscale

Others you may suggest down here.

@edqx
Copy link
Contributor
edqx commented Feb 19, 2024

I'd suggest being able to resize images? But I don't know if that entails some more complex details, for example scaling by a non-integer.

@terraquad
Copy link
Contributor

The flipping feature would be very useful when using zigimg with OpenGL, as it expects the images upside-down (to render them correctly).

@terraquad
Copy link
Contributor

Are there any plans to implement this?

@Flecart
Copy link
Contributor Author
Flecart commented Mar 19, 2025

@terraquad not that I know of.

@igor84
Copy link
Collaborator
igor84 commented Mar 19, 2025

Personally I don't think zigimg should implement this for multiple reasons. Instead someone should create a separate library for image operations that can depend on zigimg for loading and storing different formats. The reasons I see are:

  • this is reader / writer library and that is all a good number of people need so why would we force them to pull a bunch of image operations code that they don't need,
  • if it were to start adding operations there would always be someone requesting one more thing and there would be no way to set a clear boundary for this lib,
  • although a number of people are contributing to this library it is still managed by a single person on his free time and I bet just keeping an eye on all the formats, and changes required with zig compiler is not easy.

@terraquad
Copy link
Contributor

Well, I was thinking of replacing zstbi with zigimg in my project because it's one C dependency less, but if I can't flip or rotate the images they're going to be oriented the wrong way in OpenGL.

If there was at least a feature like in stbi to flip the image on import, it would be a huge help to me.

@mlarouche
Copy link
Collaborator

I'm not against adding some simple image manipulation like resizing, flipping and color conversion. For color conversion, if you convert from a RGB pixel format to grayscale it will already do the color to grayscale conversion using the proper weights for each channel.

However it would require someone else than me to do it because I would rather prefer works towards the goals in zigimg 0.1 with the limited time I can give to zigimg.

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

No branches or pull requests

5 participants
0