Added conversion of logical mask to PNG, intermediate.