  We present a new code named pyHIIextractor, which detects and extracts the
main features (positions and radii) of clumpy ionized regions, i.e. candidate
HII regions, using H{\alpha} emission line images. Our code is optimized to be
used on the dataproducts provided by the Pipe3D pipeline (or dataproducts with
such a format), applied to high spatial resolution Integral Field Spectroscopy
data (like that provided by the AMUSING++ compilation, using MUSE). The code
provides the properties of both the underlying stellar population and the
emission lines for each detected H ii candidate. Furthermore, the code delivers
a novel estimation of the diffuse ionized gas (DIG) component, independent of
its physical properties, which enables a decontamination of the properties of
the HII regions from the DIG. Using simulated data, mimicking the expected
observations of spiral galaxies, we characterise pyHIIextractor and its ability
to extract the main properties of the H ii regions (and the DIG), including the
line fluxes, ratios and equivalent widths. Finally, we compare our code with
other such tools adopted in the literature, which have been developed or used
for similar purposes: pyhIIexplorer, SourceExtractor, HIIphot, and astrodendro.
We conclude that pyHIIextractor exceeds the performance of previous tools in
aspects such as the number of recovered regions and the distribution of sizes
and fluxes (an improvement that is especially noticeable for the faintest and
smallest regions). pyHIIextractor is therefore an optimals tool to detect
candidate HII regions, offering an accurate estimation of their properties and
a good decontamination of the DIG component.
