An efficient scheme for generating ultrabrightγ-rays from the interaction of an intense laser pulse with a near-criticaldensity plasma is studied by using the two-dimensional particle-in-cell simulation including quantum electrodynamic effects.We investigate the effects of target shape onγ-ray generation efficiency using three configurations of the solid foils attached behind the near-critical-density plasma:a flat foil without a channel (target 1),a flat foil with a channel (target2),and a convex foil with a channel (target 3).When an intense laser propagates in a near-critical-density plasma,a large number of electrons are trapped and accelerated to GeV energy,and emitγ-rays via nonlinear betatron oscillation in the first stage.In the second stage,the accelerated electrons collide with the laser pulse reflected from the foil and emit high-energy,high-densityγ-rays via nonlinear Compton scattering.The simulation results show that compared with the other two targets,target 3 affords better focusing of the laser field and electrons,which decreases the divergence angle ofγ-photons.Consequently,denser and brighterγ-rays are emitted when target 3 is used.Specifically,a denseγ-ray pulse with a peak brightness of 4.6×1026photons/s/mm~2/mrad~2/0.1%BW (at 100 MeV) and 1.8×1023photons/s/mm~2/mrad~2/0.1%BW (at2 GeV) are obtained at a laser intensity of 8.5×1022W/cm~2when the plasma density is equal to the critical plasma density nc.In addition,for target 3,the effects of plasma channel length,foil curvature radius,laser polarization,and laser intensity on theγ-ray emission are discussed,and optimal values based on a series of simulations are proposed.