You could release a chapter or two for free, and request people sign up on a mailing list to receive further updates on your book. This would give you some indication of interest in your book.
Yes, this is the exact thinking! But, I would like to make the most educated guess what subject matter would work before writing two chapters of a book. Programming graphics on Canvas is a niche and I would love to know if it's a 10K programmers crowd or 100K in size?