I do not find a way to rotate the image

Hello, friends!
I’m making a weather station with a round display and I want to make the hands for the clock and other sensors a picture, but I can’t find a way to rotate the picture into an ESPhome. I would be very grateful if you could tell me a way to do this.

display:
- platform: gc9a01
 ...
  lambda: |-
    ...
    it.image(120, 120, id(arrow_image));
   ...

The standard linux package imagemagick has a tool to do that

convert -rotate 90 arrow_image arrow_image_rot

Thanks for the reply. I can rotate the arrow image in a graphical editor, like GIMP. I mean, I want to rotate the arrow images in the image output code to the display depending on the sensor readings.

Now, for example, I draw lines as arrows, but the lines don’t look very good.

int minutesX = cos((minutes * fullCircle) - roundAngle) * 60.0 + 120.0;
int minutesY = sin((minutes * fullCircle) - roundAngle) * 60.0 + 120.0;
it.line(120, 120, minutesX, minutesY, id(gray));

I would like to display an arrow image, and rotate it with a code as a minute (for example) arrow using minutes from the time component.


Many more arrows are planned in this station - for each sensor and all scales.

1 Like

Hello Pavel,

your implementation looks good,
can you show us the yaml code ?
I am planning to create such a station like yours.

Could you use an animated GIF with 60 frames and jump between the frames using animation.set_frame? Not ideal I know.