When width or height > largesize then cpaldjvu produces broken images.
This bug was introduced in commit https://github.com/barak/djvulibre/commit/1a47fd3a6396efcbcba892bb415185ddeb6d3535
This bug affects at least 3.5.29 and 3.5.28 with debian patches
Just restoring key.color for largsize to original fixes the problem
diff --git a/tools/cpaldjvu.cpp b/tools/cpaldjvu.cpp
index 336c388..db35b5c 100644
--- a/tools/cpaldjvu.cpp
+++ b/tools/cpaldjvu.cpp
@@ -428,7 +428,7 @@ CCImage::merge_and_split_ccs(int smallsize, int largesize)
}
else if (ccheight>=largesize || ccwidth>=largesize)
{
- key.color = -ccid;
+ key.color = cc->color;
for(int runid=cc->frun; runid<cc->frun+cc->nrun; runid++)
{
Run *r = & runs[runid];