implementing encoder images