In die-casting processes, the high cooling rates and pressures affect the alloy solidification and deformation behavior, and thereby impact the final mechanical properties of cast components. In this study, isothermal semi-solid compression and subsequent cooling of aluminum die-cast alloy specimens were characterized using fast synchrotron tomography. This enabled the investigation and quantification of gas and shrinkage porosity evolution during deformation and solidification. The analysis of the 4D images (3D plus time) revealed two distinct mechanisms by which porosity formed; (i) deformation-induced growth due to the enrichment of local hydrogen content by the advective hydrogen transport, as well as a pressure drop in the dilatant shear bands, and (ii) diffusion-controlled growth during the solidification. The rates of pore growth were quantified throughout the process, and a Gaussian distribution function was found to represent the variation in the pore growth rate in both regimes. Using a one-dimensional diffusion model for hydrogen pore growth, the hydrogen flux required for driving pore growth during these regimes was estimated, providing a new insight into the role of advective transport associated with the deformation in the mushy region.