some experimental tweaks, most importantly a flexible way to scale images based on abs gradient/laplacian