We consider structured optimization problems defined in terms of the sum of a smooth and convex function and a proper, lower semicontinuous (l.s.c.), convex (typically nonsmooth) function in reflexive variable exponent Lebesgue spaces L p(\cdot ) (\Omega ). Due to their intrinsic space-variant properties, such spaces can be naturally used as solution spaces and combined with space-variant functionals for the solution of ill-posed inverse problems. For this purpose, we propose and analyze two instances (primal and dual) of proximal-gradient algorithms in L p(\cdot ) (\Omega ), where the proximal step, rather than depending on the natural (nonseparable) L p(\cdot ) (\Omega ) norm, is defined in terms of its modular function, which, thanks to its separability, allows for the efficient computation of algorithmic iterates. Convergence in function values is proved for both algorithms, with convergence rates depending on problem/space smoothness. To show the effectiveness of the proposed modeling, some numerical tests highlighting the flexibility of the space L p(\cdot ) (\Omega ) are shown for exemplar deconvolution and mixed noise removal problems. Finally, a numerical verification of the convergence speed and computational costs of both algorithms in comparison with analogous ones defined in standard L p (\Omega ) spaces is presented.