Gayner Posted November 23, 2009 Share Posted November 23, 2009 I have a image, it's a blue style off photoshop applied to a random .gif image can i use a php function or something that get's the hex color from that image only the main hex color and return it back to me so i can use it. / Link to comment https://forums.phpfreaks.com/topic/182595-can-php-do-this/ Share on other sites More sharing options...
doddsey_65 Posted November 23, 2009 Share Posted November 23, 2009 do you mean you want to use the same hex color to specify background or something? if so something like PSP or GIMP tells you what the hex color is Link to comment https://forums.phpfreaks.com/topic/182595-can-php-do-this/#findComment-963736 Share on other sites More sharing options...
oni-kun Posted November 23, 2009 Share Posted November 23, 2009 Use the GD library for this, it's able to decompile images but to find the 'main' hex attribute it may be a little harder, you may need to break into algorithms for that. Link to comment https://forums.phpfreaks.com/topic/182595-can-php-do-this/#findComment-963746 Share on other sites More sharing options...
Gayner Posted November 23, 2009 Author Share Posted November 23, 2009 I just need t find the hex color of a image.. Link to comment https://forums.phpfreaks.com/topic/182595-can-php-do-this/#findComment-963759 Share on other sites More sharing options...
oni-kun Posted November 23, 2009 Share Posted November 23, 2009 Is the image a solid colour? Link to comment https://forums.phpfreaks.com/topic/182595-can-php-do-this/#findComment-963760 Share on other sites More sharing options...
iversonm Posted November 23, 2009 Share Posted November 23, 2009 Also you should check out the second sticky in php coding help. Link to comment https://forums.phpfreaks.com/topic/182595-can-php-do-this/#findComment-963761 Share on other sites More sharing options...
Gayner Posted November 23, 2009 Author Share Posted November 23, 2009 Also you should check out the second sticky in php coding help. It's actually possible bro! Link to comment https://forums.phpfreaks.com/topic/182595-can-php-do-this/#findComment-963770 Share on other sites More sharing options...
onlyican Posted November 23, 2009 Share Posted November 23, 2009 With PHP you can break down an image by pixel, which will give you the HEX Colour. If the image is not solid, you will need to put the image details into an array then work on the array to find the most used hex. WARNING!! Depending on the Image Size, this could be very heavy on your server and slow page loading. Please state your purpose for this. Link to comment https://forums.phpfreaks.com/topic/182595-can-php-do-this/#findComment-963825 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.