I want to convert images to web-safe colors using MATLAB. Is there any predefined function for it? If not, what should be my first step to start off?
I want to convert images to web-safe colors using MATLAB. Is there any predefined
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Ashish has the right approach, but you may be finding it daunting to get all those values off of the web page and into a map that you can use. You have a couple of options for creating the map…
One option is to actually get the source for the page using the function URLREAD and parse out the numbers you need using the function REGEXP (“Did he just suggest parsing HTML with a regex?!” Yes, I did. What can I say? I’m a loner, Dottie. A rebel.):
However, after I did the above I realized that there is a nice regular structure to the resulting web-safe color map values. This means you could actually ignore all the above mess and generate the map yourself using the functions REPMAT and KRON:
And then you can easily recolor, say, an RGB image using the functions RGB2IND and IND2RGB. For example: