Hi,
In classic UI Digital Assets, select any image ( Tools --> Reference) you can see all the references of an image. You can use same functionality to create utility(Servlet) which takes root path and execute below method to find out references for all the images inside root and return assets for which below method returns map size 0.
import com.day.cq.wcm.commons.ReferenceSearch;
ReferenceSearch rr = new ReferenceSearch();
Map map = rr.search(request.getResourceResolver(),"/content/dam/AEM63App/abcd.jpg");
logger.info("Map Size is {}", map.size());
You can check the size of map if it is 0 then no reference.
Thanks
Arun
Arun Patidar