The variations of galaxy stellar masses and colour-types with the distance to projected cosmic filaments are quantified using the precise photometric redshifts of the COSMOS2015 catalogue extracted from COSMOS field (2 deg$^{2}$). Realistic mock catalogues are also extracted from the lightcone of the cosmological hydrodynamical simulation Horizon-AGN. They show that the photometric redshift accuracy of the observed catalogue ($\sigma_z&lt;0.015$ at $M_*&gt;10^{10}{\rm M}_{\odot}$ and $z&lt;0.9$) is sufficient to provide 2D filaments that closely match their projected 3D counterparts. Transverse stellar mass gradients are measured in projected slices of thickness 75 Mpc between $0.5&lt; z &lt;0.9$, showing that the most massive galaxies are statistically closer to their neighbouring filament. At fixed stellar mass, passive galaxies are also found closer to their filament while active star-forming galaxies statistically lie further away. The contributions of nodes and local density are removed from these gradients to highlight the specific role played by the geometry of the filaments. We find that the measured signal does persist after this removal, clearly demonstrating that proximity to a filament is not equivalent to proximity to an over-density. These findings are in agreement with gradients measured both in 2D or 3D in the Horizon-AGN simulation and those observed in the spectroscopic VIPERS survey (which rely on the identification of 3D filaments). They are consistent with a picture in which the influence of the geometry of the large-scale environment drives anisotropic tides which impact the assembly history of galaxies, and hence their observed properties.