SQLite Forum

binary .dump format
Your major complaint seems to be that the text representation of BLOBs doubles their length.  I can understand you wanting a custom-written solution for your particular SQLite project.  But years of experience tells me you'll be better off with this solution.

1) Use the existing .dump facility to produce the text dump file
2) Use pkzip or some other command-line facility to compress the dump file.

Not only will this compress the BLOBs, it'll compress everything else too.  I haven't tried it on databases with big BLOBs but it's very good at compressing normal SQLite database dumps.  And it'll do it using standard tools, widely available on many platforms, that you don't have to write and maintain yourself.