Coding algorithm Images