Photoalignment is a simple technique for the manipulation of molecular orientations, which has been widely used in liquid crystal displays. Here, we propose a novel photoalignment method, in which an azobenzene dye thin film is deposited by thermal evaporation and in situ exposed to linearly polarized light simultaneously. We obtain polarizers with a dichroic ratio of up to 62, which is the highest value ever realized by a photoalignment method. Moreover, the polarizing thin film has a thickness of just 200 nm, compatible with flexible substrates, making it perfect for use as a dichroic polarizer in ultrathin and flexible displays.