开发者

PHP how to convert an image to Binary and use ones and noughts as variables in jquery

Hi I'd like to convert an image to binary ones and noughts and then use the ones and noughts开发者_如何学C as jquery variables so one var 0 = $(#on).attr('checked', true) var 1 = $(#on).attr('checked', false) so that I can make an image out of checked and un-checked checkboxes Thanks in advance.


This sounds pretty cool! I think you need the function imagecolorat (link) to get the color value of each pixel, then create the checkboxes (after first deciding which colors you would consider 'one' and 'nought').

Good luck! And if you have more specific questions, don't hesitate to ask.

EDIT:

Here is an example of someone determining the average color from an image. It's not the same as what you're doing, but you should be able to use much of it.

EDIT 2: This ASCII art generator may just do almost exactly what you want to do.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜