linebender / linebender/vello

Allow images with different channel counts

Open
#1,378 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

C-sparse-strips
Dominant language
Rust
Stars
4.3k
Forks
300
Avg merge
2d 13h
Merged PRs (30d)
61

Description

Currently, if you want to render an image, vello_cpu forces you do provide an RGBA image. It would be great if some custom color space layouts could be defined, in my case:
- RGBA
- RGB
- LUMA
- LUMAA

The advantage would be that the user doesn't have to reallocate a completely new buffer when converting to RGBA but can pass existing allocations, which saves a lot of memory. In my particular case, the motivation is that scanned black/white PDF pages are often very big, so in that particular case it's especially painful if you have to convert to RGBA. However, I'm also not sure it would be generally useful to others, and I see two concerns:
- If we implement this in the form of an additional generic parameter for the sampling, this could have bad effects on compile-time and binary size, especially since our current image code already relies a lot on generics.
- If we implement this in the form of a match statement, it could potentially reduce performance.

So I'm not sure if we actually should add this.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue names vello_cpu's image-rendering path but no files or tests. Start by tracing where RGBA input is required and compare representations for RGBA, RGB, LUMA, and LUMAA against the generic-versus-match tradeoffs described. Done means agreeing on an API and implementation approach that avoids unnecessary buffer conversion without unacceptable compile-time, binary-size, or performance costs.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
computer-graphics
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.