Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>To increase the depth of an emboss filter, increase the radius of the filter's mask. Low depth:</p> <pre><code>h = [[1, 0, 0] [0, 0, 0] [0, 0, -1]] </code></pre> <p>versus high depth:</p> <pre><code>h = [[1, 0, 0, 0, 0, 0, 0] [0, 0, 0, 0, 0, 0, 0] [0, 0, 0, 0, 0, 0, 0] [0, 0, 0, 0, 0, 0, 0] [0, 0, 0, 0, 0, 0, 0] [0, 0, 0, 0, 0, 0, 0] [0, 0, 0, 0, 0, 0, -1]] </code></pre> <p>To change the azimuth, place the nonzero coefficients at a different angle:</p> <pre><code>h = [[0, 0, 1] [0, 0, 0] [-1, 0, 0]] </code></pre> <p>I'm not really sure about elevation. You may need to change the nonzero coefficient values? I just know it needs to be a high-pass filter.</p> <p>In any case, to compute and display the image using a Scipy solution:</p> <pre><code>import scipy.misc, scipy.signal im = scipy.misc.imread(filename) im_out = scipy.signal.convolve2d(im, h, 'same') scipy.misc.imshow(im_out) </code></pre> <p>Hope this helps.</p> <p>EDIT: Okay, as Paul hinted with PIL, you can adjust filter parameters, or even define a completely new kernel. The scale and offset parameters have nothing to do with what you are looking for. The size of the filter is most important for adjusting depth.</p> <p>Upon further investigation, PIL does not let you change the filter size beyond 5x5. Seems strange. Therefore, you will not get as dramatic a change in depth as you probably expect.</p> <p>For total control, you may want to try the Scipy solution I and Paul mentioned earlier. Change the filter size to something ridiculous, like 21x21, and see if it makes the type of difference you want.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload