Tsonga, making his debut in Barcelona, also beat 15th-seeded Almagro at the Australian Open and last week in Monte Carlo.
Joining Tsonga in the quarterfinals was eighth-seeded David Ferrer, the runner-up to Rafael Nadal for the last two years. Ferrer won all nine games when qualifier Simone Bolelli of Italy retired with a right wrist injury.
Former French Open champion Juan Carlos Ferrero, the 2001 Barcelona winner, lost his first meeting with Thiemo de Bakker of the Netherlands 7-6 (2), 3-6, 7-6 (4).
Also winners were Thomaz Bellucci of Brazil and qualifier Eduardo Schwank of Argentina.