Inelastic deformation of ceramic powders (and of a broad class of rock-like and granular materials), can be described with the yield function proposed by Bigoni and Piccolroaz (2004, Yield criteria for quasibrittle and frictional materials. Int. J. Solids and Structures, 41, 2855-2878). This yield function is not defined outside the yield locus, so that 'gradient-based' integration algorithms of elastoplasticity cannot be directly employed. Therefore, we propose two ad hoc algorithms: (i.) an explicit integration scheme based on a forward Euler technique with a 'centre-of-mass' return correction and (ii.) an implicit integration scheme based on a 'cutoff-substepping' return algorithm. Iso-error maps and comparisons of the results provided by the two algorithms with two exact solutions (the compaction of a ceramic powder against a rigid spherical cup and the expansion of a thick spherical shell made up of a green body), show that both the proposed algorithms perform correctly and accurately.