I am trying to get a correct page structure by defining my h1, h2's and so on correctly. But I have an image with a slogan, with text that should actually be a h2.
What would be a correct way to not show text in the h2, to show the slogan, and still have a correct page structure, also for i.e. SEO and for readability?
If you want to show image text and considering the SEO then alt tag will be best for this. Yes h2 tag as effect on SEO but as well as alt tag too.
you can use it like this
<img src="#" alt="cartoon">
Here i considering cartoon word so i type like this one and it will be valid for SEO and have similar effect as h2. other thing is you can make image name as same as target keyword.
<img src="cartoon.jpg" alt="cartoon" name="cartoon">
You can see in above example, add name tag too so it will have good SEO effect without using h2 tag. hope this will help.