WIP - Color Sampler [Houdini Utility]

   5766   1   0
User Avatar
Member
25 posts
Joined: 11月 2013
Offline
Hi!

This is my entry to the Houdini Utility category:

Color Sampler

Description
Sampling colors is usually done by manually clicking on an image or the screen, one color at a time.
The Color Sampler asset can automatically sample multiple colors from an image/screen.
Points are generated over the image/screen and then each point samples the color of the nearest pixel.
The colors are then stored in a color ramp.
Manually sampling by drawing on the image/screen is also possible.
It also allows modifying the colors in various ways and the colors can be exported for use in other applications.

Features
  • Sample pixel colors by drawing or generating points on the image/screen and store the sampled colors in a ramp.
  • Resize and blur the image.
  • Sample all pixels between two or more points.
  • Snap points to pixels.
  • Sample raw or filtered (interpolated) colors.
  • Sample unique colors.
  • Sample the most frequent (or dominant) colors by grouping them by similarity or by counting the occurrences of each color.
  • Draw on the screen: manually draw points on one or more screens. Inspect pixels by showing color values, pixel coordinates and sample count next to the cursor. Enable/disable/remove strokes.
  • Draw in the viewport: manually draw points in the viewport to sample the image/screen. Resample and enable/disable/remove strokes.
  • Line sampling: use points on one or more lines to sample the image/screen. Set the line positions using local space coordinates or pixel coordinates which allows for exact positioning, rotate the lines and extend the lines to the image/screen bounds.
  • Grid sampling: use points on a grid or sample every nth pixel of the image/screen.
  • Random sampling: use randomly distributed points to sample the image/screen.
  • Input sampling: use points connected to the input pin of the node to sample the image/screen or keep the existing point colors.
  • Get the average sample color and average image color.
  • Sort colors by hue/saturation/value/brightness.
  • Compare colors using "Lab Delta E CIE94", hue, saturation or value/brightness and remove colors that differ less than a specified value.
  • Override the sampled colors by setting/adding/multiplying the hue, saturation or value/brightness.
  • Translate all of the colors in the ramp and optionally repeat the positions at the start/end of the ramp.
  • Apply noise to the position of each color in the ramp.
  • Scroll through the colors in the ramp.
  • Display samples in the viewport as points/nulls/circles/planes/boxes and as color swatches.
  • Set the sample size to the pixel size.
  • Set the image transparency and filter: "linear" for smoothed colors when zoomed in or "nearest" for a pixelated look.
  • Set the max number of colors that can be stored in the ramp, shown in the viewport and output from the node.
  • Export the colors to an image: either as the swatches shown in the viewport or as they are shown in the color ramp. Set the image size and the number of pixels per color.
  • Export the colors to a JSON text file: store the colors as float values, integer values or hex values and with a color ID.
  • Fully documented parameters.
  • Node type: SOP

Use cases
  • Link the color ramp to other ramps to apply the colors to textures or geometry.
  • Create color themes.
  • Modify existing point colors.
  • Export the colors for use in other applications.



Version: 2.8
Date: 29 September 2021


Version: 2.9
Date: 27 October 2021
Supported Houdini version: 18.5
Edited by Techie - 2021年10月27日 14:15:17

Attachments:
techie_color_sampler_2.9.hda (247.5 KB)
color_sampler_examples.hip (1.3 MB)

Houdini FX 20.5 | http://techie.se [techie.se]
User Avatar
Member
25 posts
Joined: 11月 2013
Offline
I've updated the asset to version 2.9.

  • It's now possible to display a screenshot of the selected screen in the viewport.
  • Color hue/saturation/value/brightness can now be clamped to a specific range and colors can be removed if they are outside of the range.
  • Various minor changes and fixes.
Edited by Techie - 2021年10月27日 14:04:21
Houdini FX 20.5 | http://techie.se [techie.se]
  • Quick Links