How to test equality of two images


I am new to TWIG and racing uphill.

I am stymied as I try to test whether two images are the same. One is set by a header variable - value is ‘Halloween.jpg’. The other is an item in a loop over the images in the page - value is ‘pnhbquark/blog/ Halloween16/Halloween.jpg’. I simply want to display all the images except Halloween.jpg, and whatever I try displays all of the images.
For the test I have tried
{% set raw_url =[lead_image].url %}
{# this yields exactly the same as image #}
{% for image in %}
{% if raw_url == image %}
SAME image
{% else %}
{% endif %}
{% endfor %}

{# ALSO tried {% if image|ends_with(lead_image) #}
{# and a few other things #)


Try the following: {% if raw_url == image.url %}

Gee thanks! How do you get to know all this stuff?

Another point: this line of code
{% set raw_url =[lead_image].url %}

failed when I had lead_image: Halloween2017.jpg
I had to put quotes around the filename. I was lucky because the other test files just happened to be sluglike.

Thanks again