<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-GB">
	<id>https://wiki.ai-redgio50.s5labs.eu/index.php?action=history&amp;feed=atom&amp;title=Image_Colour_Count_with_Python</id>
	<title>Image Colour Count with Python - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.ai-redgio50.s5labs.eu/index.php?action=history&amp;feed=atom&amp;title=Image_Colour_Count_with_Python"/>
	<link rel="alternate" type="text/html" href="https://wiki.ai-redgio50.s5labs.eu/index.php?title=Image_Colour_Count_with_Python&amp;action=history"/>
	<updated>2026-08-25T03:03:28Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.1</generator>
	<entry>
		<id>https://wiki.ai-redgio50.s5labs.eu/index.php?title=Image_Colour_Count_with_Python&amp;diff=469&amp;oldid=prev</id>
		<title>Admino739mjm7: Created page with &quot;&lt;strong&gt;A python-based tool for image colour count extraction. &lt;/strong&gt; &lt;div style=&quot;font-size:88%;line-height: 1.5em&quot;&gt;Image 1: Sample image for colour analysis (left) and resulting histogram with the background colour ignored (right) &lt;/div&gt;  == Asset Description == &lt;p style=&quot;line-height: 1.5em&quot;&gt; Extract colours count from an image using tools commonly available in Python: PIL for image reading and numpy. &lt;/p&gt;  == Asset Details ==...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.ai-redgio50.s5labs.eu/index.php?title=Image_Colour_Count_with_Python&amp;diff=469&amp;oldid=prev"/>
		<updated>2025-03-18T09:02:29Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;&amp;lt;strong&amp;gt;A python-based tool for image colour count extraction. &amp;lt;/strong&amp;gt; &lt;a href=&quot;/index.php?title=File:Colour_analysis.png&quot; title=&quot;File:Colour analysis.png&quot;&gt;thumb|right|&amp;lt;div style=&amp;quot;font-size:88%;line-height: 1.5em&amp;quot;&amp;gt;Image 1: Sample image for colour analysis (left) and resulting histogram with the background colour ignored (right) &amp;lt;/div&amp;gt;&lt;/a&gt;  == Asset Description == &amp;lt;p style=&amp;quot;line-height: 1.5em&amp;quot;&amp;gt; Extract colours count from an image using tools commonly available in Python: PIL for image reading and numpy. &amp;lt;/p&amp;gt;  == Asset Details ==...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;lt;strong&amp;gt;A python-based tool for image colour count extraction. &amp;lt;/strong&amp;gt; [[File:Colour analysis.png|thumb|right|&amp;lt;div style=&amp;quot;font-size:88%;line-height: 1.5em&amp;quot;&amp;gt;Image 1: Sample image for colour analysis (left) and resulting histogram with the background colour ignored (right) &amp;lt;/div&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
== Asset Description ==&lt;br /&gt;
&amp;lt;p style=&amp;quot;line-height: 1.5em&amp;quot;&amp;gt;&lt;br /&gt;
Extract colours count from an image using tools commonly available in Python: PIL for image reading and numpy.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Asset Details ==&lt;br /&gt;
=== Technical Information ===&lt;br /&gt;
&amp;lt;p style=&amp;quot;line-height: 1.5em&amp;quot;&amp;gt;&lt;br /&gt;
The implemented asset is a python script to count the occurrence of every colour in an image. The colour count is either the count of each colour present in the shape, or the count of the occurrences of the specified reference colours: if reference colours are specified, each pixel colour is counted as the closest reference colour instead as a separate colour. &lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
&amp;lt;p style=&amp;quot;line-height: 1.5em&amp;quot;&amp;gt;&lt;br /&gt;
In order to use the implemented algorithm, the user has to start by downloading the script. &lt;br /&gt;
After that, the following variables can be set:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;input_folder: set the folder containing the images for which the colour count should be computed. Defaults to the directory the script is executing;&amp;lt;/li&amp;gt; &lt;br /&gt;
&amp;lt;li&amp;gt;output_folder: set the folder to save the computation results. Defaults to the directory the script is executing;&amp;lt;/li&amp;gt;  &lt;br /&gt;
&amp;lt;li&amp;gt;optionally set the reference colours, if needed. Other colours different from the specified reference colours will be counted as the most similar reference colour. If no reference colour is specified, each colour is counted as is. Reference colours should be specified as &amp;lt;colour_name&amp;gt;: (R, G, B);&amp;lt;/li&amp;gt;  &lt;br /&gt;
&amp;lt;li&amp;gt;optionally set which colours should be ignored, e.g. the background, so that their value does not get included in the histogram computation. Reference colours should be specified as tuples of (R, G, B);&amp;lt;/li&amp;gt; &lt;br /&gt;
&amp;lt;li&amp;gt;optionally set the threshold to avoid plotting colours with an occurrence lower than such threshold. Please note that occurrences will still be computed for every colour, only the plot is affected.&amp;lt;/li&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Execute the script. The script will read the images contained in the folder specified in input_folder and for each of them it will produce in output_folder a JSON file containing the absolute and relative frequency for each colour. It will also generate a histogram for each image with the colours&amp;#039; occurrences. If a threshold is defined, only the histograms related to the colours whose relative frequency is above it will be displayed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Maturity===&lt;br /&gt;
&amp;lt;p style=&amp;quot;line-height: 1.5em&amp;quot;&amp;gt;&lt;br /&gt;
Well-established: development has reached a satisfying level of maturity and performs its task completely. No further development is planned in the future. The script will only see eventual maintenance intervention if improvement is deemed necessary. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Licence===&lt;br /&gt;
Mozilla Public Licence v2.0 - [https://www.mozilla.org/en-US/MPL/2.0/ MPL 2.0]&lt;br /&gt;
&lt;br /&gt;
== Resources ==&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Available in [https://github.com/AI-REDGIO-5-0/AIREDGIO_image_color_count GitHub]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Provided by [http://txtgroup.com/ TXT]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Acknowledgement====&lt;br /&gt;
&amp;lt;p style=&amp;quot;font-size:90%;line-height: 1.5em&amp;quot;&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;This work was performed as part of the PERNOUD pilot in the context of the AI REDGIO 5.0 project&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Relevant Categories==&lt;br /&gt;
[[Category:Python]]&lt;/div&gt;</summary>
		<author><name>Admino739mjm7</name></author>
	</entry>
</feed>