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

Support for streaming RAW images #4120

Closed
peacechen opened this issue May 30, 2024 · 2 comments
Closed

Support for streaming RAW images #4120

peacechen opened this issue May 30, 2024 · 2 comments
Labels

Comments

@peacechen
Copy link

Question about an existing feature

RAW images take up a lot of memory. Is there a way to stream RAW to reduce memory requirements?

What are you trying to achieve?

Stream RAW input to reduce memory requirements.

When you searched for similar issues, what did you find that might be related?

#220

Please provide a minimal, standalone code sample, without other dependencies, that demonstrates this question

Example from https://sharp.pixelplumbing.com/api-constructor has the entire image in memory instead of streaming.

// Read a raw array of pixels and save it to a png
const input = Uint8Array.from([255, 255, 255, 0, 0, 0]); // or Uint8ClampedArray
const image = sharp(input, {
  // because the input does not contain its dimensions or how many channels it has
  // we need to specify it in the constructor options
  raw: {
    width: 2,
    height: 1,
    channels: 3
  }
});
await image.toFile('my-two-pixels.png');

Please provide sample image(s) that help explain this question

N/A

@lovell
Copy link
Owner

lovell commented May 30, 2024

No, sorry, this is something that would probably be part of the future possible enhancement detailed at #179

@lovell
Copy link
Owner

lovell commented Jun 13, 2024

Let's continue to track this at #179

@lovell lovell closed this as completed Jun 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants