Transparent ML screenshot overlays / Screenshot overhaul

Started by Audionut, February 17, 2014, 10:47:54 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Audionut

a1ex has overhauled the screenshot function.

The pull request can be found here.

Advantages:

  • Does not rely on Canon's dispcheck (which suffers from memory errors, corrupted output, inconsistent paths, camera-specific quirks... all these are fixed)
  • Captures both BMP and YUV in a single screenshot (partial transparency support)
  • Handles ML palette tweaks
  • You can specify custom file names or patterns (e.g. "ML/TEST/myscr%02d.ppm")

Disadvantages:

  • Larger file sizes (1MB). Important?
  • PPM file format may not be very common in the Windows world. Important? I believe common image viewers (IrfanView?) can open them easily.
  • [SOLVED] you no longer get the full YUV buffer (you only get this data in transparent areas). Important?

API change: take_screenshot (now it also accepts a custom file name, which is optional). Any other modules calling this? From ML modules, only raw_rec and mlv_rec use this one, and only for debugging, so do we need to bump the API version because of this change? (I'd say no)

API addition: in the process I've added another API, get_numbered_file_name, to help with numbered sequences of files (here, VRAMnnnn.PPM) and refactored silent pictures with this one. Is this API sufficient to cover our use cases for these file sequences?

I make heavy use of screenshots in raw_diag (will update it after merging this one).

TODO:

  • [DONE] add PPM file support to pic_view (should be easy).
  • HDMI support (right now it will only save the central 720x480 crop). Important?
  • Better transparency support. Important? any examples where this code fails?
  • [DONE] full-res YUV screenshots (now it captures only 360x480). Important?
  • BT.601 support in rgb2yuv422 (without it, colors might be a little off on old cameras). Important?

Here is an idea of what the new screenshot function can capture.




Original post:
QuoteDoes anyone know who to make ML screenshots with transparent backgrounds?

For instance, you could have a screenshot of zebras overlayed on the resulting image.

edit:  I assume this is a post processing job.

a1ex

Yes, it's postprocessing. In GIMP, you can layer the BMP on top of the JPG converted from the 422 file, select everything that has the background color, and delete that part.

It is quite easy to output a PPM instead of a BMP+422 (other formats may be more complex), just boring to code. But it will also solve the inconsistency on 5D3, where the BMP may end up on one card (since it's saved by Canon code) and the 422 may end up on the other card (since it's saved by ML code). Not sure if it counts as easy enough for EasyCoding tasks (I'd say just a notch above them, in difficulty).

Audionut

Thanks a1ex.  A bunch of ML overlays should help with the guide I am doing.


This doesn't solve the inconsistency?  https://bitbucket.org/hudson/magic-lantern/pull-request/398/make-core-ml-support-multiple-card-slots/diff

a1ex

No, it's refactoring and backporting the 5D3 FIO wrappers (where ML autodetects the card and fills in the drive letter) to all other cameras.

a1ex


dmilligan

For anybody who might be making tutorials or whatnot, I made a little module to take a screenshot after every button press

scrnshot.mo
source code

(now I just need a script to dump the ppms to an animated gif...)

kichetof



monograph

5D3

LvP

Quote from: dmilligan on March 05, 2014, 10:53:41 PM
For anybody who might be making tutorials or whatnot, I made a little module to take a screenshot after every button press

scrnshot.mo
source code

(now I just need a script to dump the ppms to an animated gif...)


I have the 600D with the newst nightly on board. But i can not load the scrnshot modul.
What is wrong ? Please help me


dmilligan

They are not compatible (the module is too old), either recompile the screenshot module with the latest nightly or use an older build (one from before the module version changed to 6)

LvP

How can i ascertain which nightly version has the modul version v.5 ? Is it difficult to recompile the screenshot modul to v.6 ?