CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Visualization & Post-Processing Software > ParaView

[General] transplant colormaps from paraview to MATLAB

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 6, 2023, 23:27
Default transplant colormaps from paraview to MATLAB
  #1
Senior Member
 
Join Date: Oct 2017
Location: United States
Posts: 233
Blog Entries: 1
Rep Power: 10
TurbJet is on a distinguished road
Hi,

I'm trying to implement some of the colormaps in paraview to matlab. I found a website that provides the data (link: https://kitware.github.io/paraview-d...colorMaps.html).

For example, I'm trying to implement this BuRd colormap
Code:
  <ColorMap name="BuRd" space="Lab">
    <Point x="-1" o="1" r="0.019608" g="0.188235" b="0.380392"/>
    <Point x="-0.87451" o="1" r="0.088504" g="0.321107" b="0.564937"/>
    <Point x="-0.74902" o="1" r="0.163399" g="0.444983" b="0.697501"/>
    <Point x="-0.623529" o="1" r="0.247059" g="0.555709" b="0.754095"/>
    <Point x="-0.498039" o="1" r="0.420684" g="0.676432" b="0.818685"/>
    <Point x="-0.372549" o="1" r="0.606459" g="0.789773" b="0.880277"/>
    <Point x="-0.247059" o="1" r="0.761476" g="0.868512" b="0.924567"/>
    <Point x="-0.121569" o="1" r="0.878047" g="0.925721" b="0.951942"/>
    <Point x="0.00392157" o="1" r="0.969089" g="0.966474" b="0.964937"/>
    <Point x="0.129412" o="1" r="0.983852" g="0.897578" b="0.846828"/>
    <Point x="0.254902" o="1" r="0.982468" g="0.800692" b="0.706113"/>
    <Point x="0.380392" o="1" r="0.960323" g="0.66782" b="0.536332"/>
    <Point x="0.505882" o="1" r="0.894579" g="0.503806" b="0.399769"/>
    <Point x="0.631373" o="1" r="0.81707" g="0.33218" b="0.281046"/>
    <Point x="0.756863" o="1" r="0.728489" g="0.155017" b="0.197386"/>
    <Point x="0.882353" o="1" r="0.576932" g="0.055363" b="0.14925"/>
    <Point x="1" o="1" r="0.403922" g="0" b="0.121569"/>
  </ColorMap>
The head indicates that the values r/g/b here is in the LAB space, not the usual RGB space. However, when I used MATLAB built-in function lab2rgb to convert these values to RGB, the results are clearly wrong (some are negative, some are beyond 1). If I just use these numbers as they are, the resulting colors are wrong.

Does any one have experience in this?
TurbJet is offline   Reply With Quote

Reply

Tags
color map, matlab coding, paraview


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
[OpenFOAM.org] Paraview 5.4 in shell environment of5x - Segmentation fault (core dumped) dslbkxd OpenFOAM Installation 1 February 3, 2018 01:56
Error: Comparing the result of DTCHullWaves with two different ParaView version ali.ikhsanul OpenFOAM 0 December 11, 2017 06:17
[General] Plotting solution vector from Matlab in Paraview crg123 ParaView 0 November 20, 2016 13:19
[General] Paraview launch & crash problems dancfd ParaView 3 January 17, 2013 13:04
[General] paraview ignores SPACING in STRUCTURED_POINTS vtk data? jaffar ParaView 0 November 27, 2012 10:36


All times are GMT -4. The time now is 18:55.