not optimised pixel-based image algorithm