cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - Activehtmlicon-personicon-teamoctocatspinnerstartv

Pen Settings

CSS Base

Vendor Prefixing

Add External CSS

These stylesheets will be added in this order and before the code you write in the CSS editor. You can also add another Pen here, and it will pull the CSS from it. Try typing "font" or "ribbon" below.

Quick-add: + add another resource

Add External JavaScript

These scripts will run in this order and before the code in the JavaScript editor. You can also link to another Pen here, and it will run the JavaScript from it. Also try typing the name of any popular library.

Quick-add: + add another resource

Code Indentation

     

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

            
              <aside class="sidebar">
  <h1>Sidebar</h1>
</aside> 

<section class="main">
  <header class="main-header">
    <h1>Header</h1>
  </header>

  <div class="main-body-wrapper">
    <article class="main-body">
      <h1>Main content</h1>

      <p>
        darktablethe photo workflow softwareMain menuSkip to primary contentSkip to secondary content
        news
        about
        blog
        install
        resources
        development
        contact
        the rainy cord chord, © 2011 Rostyslav Pidgornyi
        Post navigation← Previous Next →
        lmaskdtyellow
        Luminosity Masks in Darktable
        Posted on January 18, 2015 by Mueen Nawaz
        Pat David has a great blog on photoediting in GIMP. I recently read his post on luminosity masks and was fairly impressed. Can darktable do something similar? Yes - they're a special case of parametric masks.

        I thought I'd post a quick tutorial on luminosity masks using parametric masks. First, I strongly suggest you read Pat David's post and thoroughly understand what's going on.

        A quick and simplistic explanation follows: Normally, if we make a selection and, say, adjust the brightness dramatically in that selection, we get a sharp (and ugly) transition near the edge of the selection:
        sharpedge

        The quick solution is to blur the mask (feathering in GIMP). Feathering simply makes the transition less sharp:
        sharpedge1

        Better, but still too sharp a transition. You can feather it even more if you wish, but however much you feather it, the transition is determined too heavily by your choice of selection (a rectangle in this case). We'd really like is a way to select based on the actual contents of the image.

        What luminosity masks do is let you select regions in your image in proportion to their brightness. So the L layer in Pat's article fully selects completely bright pixels, and only partially selects pixels that are half as bright, and doesn't select pixels that are not bright at all. When you now brighten the image, the effect of the brightening is greatest on the brightest pixels, and least on the darkest pixels. There are no sharp transitions like what I have in my screenshots above.

        In that sense, some refer to these masks as self-feathering.

        So how can we do this in darktable?

        Consider the following image:
        baseimage

        Let's say I want to brighten it. Let me apply an aggressive curve:
      </p>
    </article>

    <aside class="secondary-sidebar">
      <h1>Secondary sidebar</h1>
    </aside>
  </div>

  <footer class="main-footer">
    <h1>Footer</h1>
  </footer>
</section>
            
          
!
            
              @import "lesshat";

@sidebar-width: 200px;
@sidebar-bgcolor: #FBE9D5;
@secondary-sidebar-width: 160px;
@secondary-sidebar-bgcolor: #EBDDF0;
@header-height: 50px;
@header-bgcolor: #FCF3CF;
@footer-height: 100px;
@footer-bgcolor: #fff;
@main-bgcolor: #D6EAF7;

* {
  box-sizing: border-box;
}

html, body {
  width: 100%;
  height: 100%;
}

h1 {
  font-size: 1.3em;
}

body {
  display: table;
}

.sidebar {
  width: @sidebar-width;
  display: table-cell;
  background: @sidebar-bgcolor;
  padding: 2em;
  vertical-align: middle;
  text-align: center;
}

.main {
  position: relative;
  display: table-cell;
  background: @main-bgcolor;

}

.main-header {
  position: absolute;
  top: 0;
  width: 100%;
  background: @header-bgcolor;
  border-left: solid 2px #F2BE43;
  height: @header-height;
  vertical-align: middle;
  text-align: center;
}

.main-body-wrapper {
  padding-top: @header-height;
  padding-bottom: @footer-height;
  min-height: 100%;
  display: table;
}

  .main-body {
    display: table-cell;
    border-width: 2px;
    border-style: solid;
    border-top-color: #91BDBB;
    border-right-color: #82A8DD;
    border-bottom-color: #8FA8C8;
    border-left-color: #9AABAB;
    padding: 2em;
    vertical-align: top;
  }

  .secondary-sidebar {
    display: table-cell;
    width: @secondary-sidebar-width;
    background: #EBDDF0;
    border-top: solid 2px #C79CA8;
    border-bottom: solid 2px #C98BB4;
    padding: 2em;
    vertical-align: middle;
    text-align: center;
  }

.main-footer {
  background: #FADBD8;
  height: @footer-height;
  position: absolute;
  bottom: 0;
  width: 100%;
  border-left: solid 2px #F1A274;
  padding: 2em;
  vertical-align: middle;
  text-align: center;
}
            
          
!
999px
Close

Asset uploading is a PRO feature.

As a PRO member, you can drag-and-drop upload files here to use as resources. Images, Libraries, JSON data... anything you want. You can even edit them anytime, like any other code on CodePen.

Go PRO

Loading ..................

Console