gradient

Python Pillow(PIL) Not completely recoloring gradients?

Python Pillow(PIL) Not completely recoloring gradients? Question: I am having an issue where I’m using Pillow to recolor an image that has a lot of soft gradients but it seems to not completely color the most translucent part of these gradients, with the recolored image having a gradient that is not as smooth. Is there …

Total answers: 1

Elevation (XYZ) data to slope/gradient map using python

Elevation (XYZ) data to slope/gradient map using python Question: I have a text file with Easting (x), Northing (y), and Elevation data (z) as shown below: x y z 241736.69 3841916.11 132.05 241736.69 3841877.89 138.76 241736.69 3841839.67 142.89 241736.69 3841801.45 148.24 241736.69 3841763.23 157.92 241736.69 3841725.02 165.01 241736.69 3841686.80 171.86 241736.69 3841648.58 178.80 241736.69 3841610.36 …

Total answers: 2

Sobel and Laplace results appear in grayscale

Sobel and Laplace results appear in grayscale Question: I have been trying to follow the tutorial on image gradients found on this link https://docs.opencv.org/3.0-beta/doc/py_tutorials/py_imgproc/py_gradients/py_gradients.html The results for Laplacian, Sobel x, and Sobel y appear in black and white according to the tutorial. But my results appear in gray. I cannot seem to find the reason …

Total answers: 2

PIL: Generating Vertical Gradient Image

PIL: Generating Vertical Gradient Image Question: In Android, I used the following code to generate a gradient background that I need: <gradient android_angle=”90″ android_startColor=”#40000000″ android_endColor=”#00000000″ android_type=”linear” /> The background goes from light to relatively dark from top to bottom. I wonder how to do the same in Python with PIL, since I need the same …

Total answers: 5

Calculating gradient with NumPy

Calculating gradient with NumPy Question: I really can not understand what numpy.gradient function does and how to use it for computation of multivariable function gradient. For example, I have such a function: def func(q, chi, delta): return q * chi * delta I need to compute it’s 3-dimensional gradient (in other words, I want to …

Total answers: 5

How to plot a gradient color line in matplotlib?

How to plot a gradient color line in matplotlib? Question: To state it in a general form, I’m looking for a way to join several points with a gradient color line using matplotlib, and I’m not finding it anywhere. To be more specific, I’m plotting a 2D random walk with a one color line. But, …

Total answers: 7

2D grid data visualization in Python

2D grid data visualization in Python Question: I need to visualize some data. It’s basic 2D grid, where each cell have float value. I know how to e.g. assign color to value and paint grid in OpenCV. But the point here is that there are so many values so it’s nearly impossible to do that. …

Total answers: 2