I am trying to find background color of png images having grey color or not.
Do you have any ideas?
I am trying to find background color of png images having grey color or not.
Do you have any ideas?
If you speak about background-color of images in html, jquery can do the trick:
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<img src="image.png" id='image_id' style="background-color:Gray;" />
<script type="text/javascript">
console.log($('#image_id').css('background-color'));
if( $('#image_id').css('background-color') == 'rgb(128, 128, 128)' ) {
console.log('Gray!');
} else {
console.log('Not gray');
}
</script>