encode pic