0

I am trying to find a way to turn a circle into segments in Javascript and then download the resulting sectors in image files that are sector-shaped. However, I am unsure how to make sectors from an image and download the resulting sector without any background (I do not want to create a square image and instead want to make a sector-shaped image). I tried cropping images with HTML Canvas (see here for the cropping method I used), but I could not find a way to cut the image into a sector instead of a rectangle and download the image as a sector instead of a rectangle. How should I go about programming this problem? Here is an example of what I want to do (I used photoshop):

Given this circular image, I want to cut it into four equally-sized sectors programmatically: 1, 2, 3, 4.

Snakeryan
  • 11
  • 3
  • Do you know any image format that does support non rectangular images? If there is, I bet there isn't much consumer able to display it. What's wrong with a rectangular image that has transparent pixels? – Kaiido Apr 17 '22 at 06:51
  • Thanks for the response! I am fine using a rectangular image if the background is transparent. I am mainly looking for a way to cut an image into sectors? – Snakeryan Apr 17 '22 at 18:28

0 Answers0