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

better screenshots #1548

Closed
catfact opened this issue Apr 3, 2022 · 0 comments · Fixed by #1669
Closed

better screenshots #1548

catfact opened this issue Apr 3, 2022 · 0 comments · Fixed by #1669
Labels
enhancement good first issue help wanted matron involves matron (C application layer)

Comments

@catfact
Copy link
Collaborator

catfact commented Apr 3, 2022

currently, people making screenshots typically post-process them in imagemagick.

i fielded a question about adding imagemagick to the base image as follows:

IMHO just making screenshots is not sufficient call for installing Magick, which is pretty big (iirc?) and has lots of dependenc ies for dealing with all possible graphics formats. I would either:

  • export a trivial format like PGM direct from Lua
  • if PNG format is preferred, add a dedicated function in C that uses libpng (and probably upsamples)

The required form of upsampling is trivial (no interp), for example to 3x upscale:

  • allocate temp line buffer of 128x3 levels
  • for each line in source buffer:
    • for each column, copy the source level to the next 3 positions in the line buffer
    • write the whole tmp line buffer to output file 3 times

To put it kind of bluntly, I don't like burning 2.5% of every CM3 users system shortage to save us writing ~10 lines of code.

so in other words, maybe it would be nice to update the screen_export_png function here:
https://github.com/monome/norns/blob/main/matron/src/hardware/screen.c#L399

to perform upsampling and inversion (on a temporary surface.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement good first issue help wanted matron involves matron (C application layer)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant