Ribbon lattices are kind of transition systems in between one and two dimensions, and their study is crucial to understand the origin of different emerging properties. In this work, we study a Lieb ribbon lattice and the localization-delocalization transition occurring due to a reduction of lattice distances (compression) and the corresponding flat band deformation. We observe how above a critical compression ratio the energy spreads out and propagates freely across the lattice, therefore transforming the system from being a kind of insulator into a conductor. We implement an experiment on a photonic platform and show an excellent agreement with the predicted phenomenology. Our findings suggest and prove experimentally the use of compression or mechanical deformation of lattices to switch the transport properties of a given system.