{"id":20613862,"url":"https://github.com/mmesch/cmap_builder","last_synced_at":"2025-04-15T07:23:51.564Z","repository":{"id":149406801,"uuid":"59185868","full_name":"MMesch/cmap_builder","owner":"MMesch","description":"three blender scripts that allow to design 1d and 2d colormaps within a colorspace gamut","archived":false,"fork":false,"pushed_at":"2017-11-06T08:27:18.000Z","size":34426,"stargazers_count":38,"open_issues_count":0,"forks_count":2,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-03-28T17:48:11.878Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MMesch.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2016-05-19T07:57:06.000Z","updated_at":"2023-06-02T06:44:03.000Z","dependencies_parsed_at":null,"dependency_job_id":"a1b9fba9-5492-4257-9f3e-67075229d223","html_url":"https://github.com/MMesch/cmap_builder","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MMesch%2Fcmap_builder","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MMesch%2Fcmap_builder/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MMesch%2Fcmap_builder/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MMesch%2Fcmap_builder/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MMesch","download_url":"https://codeload.github.com/MMesch/cmap_builder/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249024718,"owners_count":21200172,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-16T11:11:17.105Z","updated_at":"2025-04-15T07:23:51.545Z","avatar_url":"https://github.com/MMesch.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# colormap2d\nThis python package provides a carefully designed set of 2D colormaps that live in the perceptually uniform colorspace CAM02-UCS (Luo et al., 2006; Smith et al., 2016). Functionality to use the colormaps with matplotlib is included, as well as scripts that can be used from the 3D animation software Blender to design them.\n\n2D colormaps are used to visualise images of two parameters at the same time, e.g.:\n* a complex function's magnitude and argument as a function of its real and imaginary part\n* a spatial map of windspeed and direction\n* a time-frequency image of a signals strength and phase (spectrogram)\n* a spatial map of seismic source energy and frequency.\n\n## Features\n* a growing set of carefully designed 2D colormaps\n* matplotlib style python functions to plot data using the 2D colormaps\n* 2D colormap designer based on the 3D animation software blender\n\n## Installation\nThe module can be installed directly from github using:\n```\npip install git+https://github.com/MMesch/cmap_builder.git\n```\n\n## Example\n```\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom colormap2d import imshow2d\n\n# complex input data\nx = np.linspace(-5, 5, 100)\nregrid, imgrid = np.meshgrid(x, x)\nzgrid = regrid + 1j * imgrid\n\ncomplex_function = (zgrid ** 2 - 2.) * (zgrid - 1 - 1j) ** 2 /\\\n                   (zgrid + 2j) / (zgrid**2 - 5 - 2j)\n\n\n# assemble [2, nwidth, nheight] array\ndata = np.array([np.angle(complex_function),\n                 np.log(np.abs(complex_function))])\n\n# plot to screen\nimshow2d(data, cmap2d='wheel')\nplt.show()\n```\n![simple example](images/simple_example.png)\n\n## Blender Colormap Designer\nThe associated blender script allows to generate colormaps in the uniform\ncolorspace CAM02-UCS (thank you colorspacious) by drawing a 3d spline path or a\n3d spline surface in blender.\n\nThe most common 2D colormap used varies linearly in HSV/HSL colorspace. This\ncolormap is unfortunately not very smooth visually. The following image shows a\ncolormap that has been designed in blender. It starts at white and then goes\ninto the six corners of the CAM02-UCS Gamut.\n\n![brightwheel2d](images/brightwheel2d.png)\n\nBlender designed colormaps are much smoother than the classical HSV colormap.\nThe following comparison shows a complex polynomial that has poles. HSV\nis shown in the top row as reference.\n\n![poles and zeros function](images/poles_and_zeros.png)\n\nClick [here](doc/gallery.md) to see more colormaps in 3d colorspace.\n\nClick [here](doc/install.md) to see how to install and use the script.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmmesch%2Fcmap_builder","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmmesch%2Fcmap_builder","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmmesch%2Fcmap_builder/lists"}