Both options suggested by Dr. Mercier are great. I personally use ImageJ as well and there are few guidelines and instructions online. I have also encountered some publications in which people have carried our porosity measurements from images by microscopes built in software such as Leica.