So here's what I'd do if I was in your shoes. I've never written a book, but I've read a few so lets try.
1) Are you sure it's piracy that's killing sales?
I just looked over at my bookshelf and the last book I have purchased on any topic related to computing is circa 2006.
I write software. I do *not* pirate books. I can simply find the information I need on the web for free from other sources (blogs, forums, communities, the manufacturer of the software).
2) Remember that not every downloaded copy of a book is a lost sale.
I can understand someone wanting to take a look at the content of the book before deciding to spend $50. Maybe they did and they didn't like it. I'm not saying they acted morally, that's not the point. The world is what it is and this is how a lot of people behave.
You mentioned in a comment that this is print on demand which I'm going to guess means I can't walk into a Borders or Barnes&Noble down the street and take a look at your book to see if I'm going to benefit from it.
I might consider finding a way to peek inside before plucking down the $50 bucks.
3) Some of those downloads are lost sales.
Do you offer an electronic version (preferably one that's not tied only to the Kindle)?
Again, back to my first point, if I'm reading about something related to computing I'm usually doing so in front of my computer on a web site that I do not pay to access.
I haven't read your book, but I have read a lot about data compression and there are so many free resources that spending $50 on a book covering this topic is something I wouldn't ever consider doing.
I might spend $10 (PDF, electronic, not physical) if that's a topic I'm interested in and I know I can get an unrestricted electronic version legitimately.
I don't know how the publishing industry works, so maybe the last option isn't available to you. If it isn't and you really want to continue writing on technical topics, you may want to find a better publisher.
It's a keeper!Pig was so upset he sat down and started to cry: "This magic box is nothing but trouble!"
"Oh, Pig!" said Duck, "don't feel bad! It's not your fault! It's OUR fault for not using the buckets according to the terms and conditions set forth in the End User License Agreements we signed upon receipt of the merchandise!"
Never let someone who says it cannot be done interrupt the person who is doing it.