Author Topic: Transparent ML screenshot overlays / Screenshot overhaul  (Read 8661 times)

Audionut

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3372
  • I have a 1Dx, I'm awesome.
Transparent ML screenshot overlays / Screenshot overhaul
« on: February 17, 2014, 10:47:54 AM »
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:
Quote
Does 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

  • Administrator
  • Hero Member
  • *****
  • Posts: 9943
  • 5D Mark Free
Re: Transparent ML screenshot overlays
« Reply #1 on: February 17, 2014, 12:06:01 PM »
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

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3372
  • I have a 1Dx, I'm awesome.
Re: Transparent ML screenshot overlays
« Reply #2 on: February 17, 2014, 12:20:55 PM »
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

  • Administrator
  • Hero Member
  • *****
  • Posts: 9943
  • 5D Mark Free
Re: Transparent ML screenshot overlays
« Reply #3 on: February 17, 2014, 12:24:03 PM »
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

  • Administrator
  • Hero Member
  • *****
  • Posts: 9943
  • 5D Mark Free
Re: Transparent ML screenshot overlays
« Reply #4 on: March 03, 2014, 12:18:48 PM »
Seems to work: https://bitbucket.org/hudson/magic-lantern/pull-request/424/ppm-screenshots-that-no-longer-rely-on

and should fix most (hopefully all) the inconsistencies from the old dispcheck.

dmilligan

  • Developer
  • Hero Member
  • *****
  • Posts: 3182
  • 60Da / 1100D / EOSM
Re: Transparent ML screenshot overlays / Screenshot overhaul
« Reply #5 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...)

kichetof

  • Senior
  • ****
  • Posts: 423
  • Take a beer and enjoy it!
Re: Transparent ML screenshot overlays / Screenshot overhaul
« Reply #6 on: March 05, 2014, 11:06:21 PM »
Great works !!

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

http://jupiter.ethz.ch/~pjt/makingMovies.html :)

Code: [Select]
convert -delay 20 test*ppm movie.gif

dmilligan

  • Developer
  • Hero Member
  • *****
  • Posts: 3182
  • 60Da / 1100D / EOSM

monograph

  • New to the forum
  • *
  • Posts: 12
Re: Transparent ML screenshot overlays / Screenshot overhaul
« Reply #8 on: March 17, 2014, 07:25:35 PM »
dmilligan, your scrnshot module is great ;)
5D3

LvP

  • New to the forum
  • *
  • Posts: 16
Re: Transparent ML screenshot overlays / Screenshot overhaul
« Reply #9 on: September 21, 2015, 07:41:13 AM »
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

  • Developer
  • Hero Member
  • *****
  • Posts: 3182
  • 60Da / 1100D / EOSM
Re: Transparent ML screenshot overlays / Screenshot overhaul
« Reply #10 on: September 21, 2015, 01:00:36 PM »
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

  • New to the forum
  • *
  • Posts: 16
Re: Transparent ML screenshot overlays / Screenshot overhaul
« Reply #11 on: September 21, 2015, 06:24:02 PM »
How can i ascertain which nightly version has the modul version v.5 ? Is it difficult to recompile the screenshot modul to v.6 ?