Draw color-coded lines in image.

LINES2IM generates an image with painted lines. The line-hues are the angles of the slopes.

You are now following this Submission

Given a set of line coordinates:
X = [startx1 endx1; startx2 endx2;...]
Y = [starty1 endy1; starty2 endy2;...]
and a wanted image resolution, this code will generate the sparse matrix HUE, and the images BW, RGB and HSV, all with the desired resolution.
I made this to simplify edge-analysis of image-edge-lines gained from hough-transformation. (But you could also paint with it, as I did when making the screen-shot.)

Cite As

Jan Heldal (2026). Draw color-coded lines in image. (https://se.mathworks.com/matlabcentral/fileexchange/34834-draw-color-coded-lines-in-image), MATLAB Central File Exchange. Retrieved .

General Information

MATLAB Release Compatibility

  • Compatible with any release

Platform Compatibility

  • Windows
  • macOS
  • Linux
Version Published Release Notes Action
1.0.0.0