diff --git a/src/PIL/ImageDraw.py b/src/PIL/ImageDraw.py
index 7abd459f9..cbecf652d 100644
--- a/src/PIL/ImageDraw.py
+++ b/src/PIL/ImageDraw.py
@@ -156,6 +156,8 @@ class ImageDraw:
         if ink is not None:
             self.draw.draw_lines(xy, ink, width)
             if joint == "curve" and width > 4:
+                if not isinstance(xy[0], (list, tuple)):
+                    xy = [tuple(xy[i : i + 2]) for i in range(0, len(xy), 2)]
                 for i in range(1, len(xy) - 1):
                     point = xy[i]
                     angles = [

Bug with line joints
### What did you do?

When I use the `joint='curve'` attribute on the line method with a sequence of numeric value, I get an error.

### What did you expect to happen?

[The documentation say](https://pillow.readthedocs.io/en/stable/reference/ImageDraw.html#PIL.ImageDraw.PIL.ImageDraw.ImageDraw.line) that you can pass *Sequence of either 2-tuples or numeric values*.

So, this should work:
```pycon
>>> from PIL import Image, ImageDraw
>>> im = Image.new('RGB', (800, 600))
>>> draw = ImageDraw.Draw(im)
>>> draw.line((400, 200, 300, 280, 100, 280), 0, 50, joint='curve')
```


### What actually happened?

 *Sequence of 2-tuples*  and `joint='curve'` works fine :

```pycon
>>> draw.line(((400, 200), (300, 280), (100, 280)), 0, 50, joint='curve')
```

*Sequence of numeric values*, but no `joint='curve'` works fine : 

```pycon
>>> draw.line((400,200,300,280,100,280), 0, 50)
```

*Sequence of numeric values*   and `joint='curve'` doesn't work :
```pycon
>>> draw.line((400,200,300,280,100,280), 0, 50, joint='curve')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/leon/virtualenvs/ogn/lib/python3.5/site-packages/PIL/ImageDraw.py", line 165, in line
    for start, end in ((xy[i-1], point), (point, xy[i+1]))
  File "/home/leon/virtualenvs/ogn/lib/python3.5/site-packages/PIL/ImageDraw.py", line 165, in <listcomp>
    for start, end in ((xy[i-1], point), (point, xy[i+1]))
TypeError: 'int' object is not subscriptable
```

### What are your OS, Python and Pillow versions?

* OS: Debian Linux
* Python: 3.5.3
* Pillow: '5.4.1'

diff --git a/Tests/test_imagedraw.py b/Tests/test_imagedraw.py
index f6eabb21a..7ecec48d3 100644
--- a/Tests/test_imagedraw.py
+++ b/Tests/test_imagedraw.py
@@ -873,28 +873,93 @@ def test_wide_line_dot():
     assert_image_similar(im, Image.open(expected), 1)
 
 
-def test_line_joint():
+@pytest.mark.parametrize(
+    "xy",
+    [
+        [
+            (400, 280),
+            (380, 280),
+            (450, 280),
+            (440, 120),
+            (350, 200),
+            (310, 280),
+            (300, 280),
+            (250, 280),
+            (250, 200),
+            (150, 200),
+            (150, 260),
+            (50, 200),
+            (150, 50),
+            (250, 100),
+        ],
+        (
+            400,
+            280,
+            380,
+            280,
+            450,
+            280,
+            440,
+            120,
+            350,
+            200,
+            310,
+            280,
+            300,
+            280,
+            250,
+            280,
+            250,
+            200,
+            150,
+            200,
+            150,
+            260,
+            50,
+            200,
+            150,
+            50,
+            250,
+            100,
+        ),
+        [
+            400,
+            280,
+            380,
+            280,
+            450,
+            280,
+            440,
+            120,
+            350,
+            200,
+            310,
+            280,
+            300,
+            280,
+            250,
+            280,
+            250,
+            200,
+            150,
+            200,
+            150,
+            260,
+            50,
+            200,
+            150,
+            50,
+            250,
+            100,
+        ],
+    ],
+)
+def test_line_joint(xy):
     im = Image.new("RGB", (500, 325))
     draw = ImageDraw.Draw(im)
     expected = "Tests/images/imagedraw_line_joint_curve.png"
 
     # Act
-    xy = [
-        (400, 280),
-        (380, 280),
-        (450, 280),
-        (440, 120),
-        (350, 200),
-        (310, 280),
-        (300, 280),
-        (250, 280),
-        (250, 200),
-        (150, 200),
-        (150, 260),
-        (50, 200),
-        (150, 50),
-        (250, 100),
-    ]
     draw.line(xy, GRAY, 50, "curve")
 
     # Assert

pip install -e .[dev]
parse_log_pytest
requirements.txt
apt-get update apt-get install -y gcc libjpeg-dev zlib1g-dev libtiff5-dev libfreetype6-dev liblcms2-dev libwebp-dev tcl8.6-dev tk8.6-dev libharfbuzz-dev libfribidi-dev libxcb1-dev
3.9
requirements.txt
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
alabaster==0.7.16
babel==2.17.0
black==25.1.0
blessed==1.20.0
build==1.2.2.post1
certifi==2025.1.31
charset-normalizer==3.4.1
check-manifest==0.50
click==8.1.8
coverage==7.8.0
docutils==0.21.2
exceptiongroup==1.2.2
idna==3.10
imagesize==1.4.1
importlib_metadata==8.6.1
iniconfig==2.1.0
jarn.viewdoc==2.7
Jinja2==3.1.6
MarkupSafe==3.0.2
mypy-extensions==1.0.0
olefile==0.47
packaging==24.2
pathspec==0.12.1
-e git+https://github.com/python-pillow/Pillow.git@556c87c90490cdbd893c0b9f97618533eb6d5bc1#egg=Pillow
platformdirs==4.3.7
pluggy==1.5.0
pycodestyle==2.13.0
pyflakes==3.3.1
Pygments==2.19.1
pyproject_hooks==1.2.0
pyroma==4.2
pytest==8.3.5
pytest-cov==6.0.0
requests==2.32.3
six==1.17.0
snowballstemmer==2.2.0
Sphinx==7.4.7
sphinx-rtd-theme==3.0.2
sphinxcontrib-applehelp==2.0.0
sphinxcontrib-devhelp==2.0.0
sphinxcontrib-htmlhelp==2.1.0
sphinxcontrib-jquery==4.1
sphinxcontrib-jsmath==1.0.1
sphinxcontrib-qthelp==2.0.0
sphinxcontrib-serializinghtml==2.0.0
tomli==2.2.1
trove-classifiers==2025.3.19.19
typing_extensions==4.13.0
urllib3==2.3.0
wcwidth==0.2.13
zipp==3.21.0

name: Pillow
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - ca-certificates=2025.2.25=h06a4308_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.4.4=h6a678d5_1
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - ncurses=6.4=h6a678d5_0
  - openssl=3.0.16=h5eee18b_0
  - pip=25.0=py39h06a4308_0
  - python=3.9.21=he870216_1
  - readline=8.2=h5eee18b_0
  - setuptools=75.8.0=py39h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - tzdata=2025a=h04d1e81_0
  - wheel=0.45.1=py39h06a4308_0
  - xz=5.6.4=h5eee18b_1
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - alabaster==0.7.16
      - babel==2.17.0
      - black==25.1.0
      - blessed==1.20.0
      - build==1.2.2.post1
      - certifi==2025.1.31
      - charset-normalizer==3.4.1
      - check-manifest==0.50
      - click==8.1.8
      - coverage==7.8.0
      - docutils==0.21.2
      - exceptiongroup==1.2.2
      - idna==3.10
      - imagesize==1.4.1
      - importlib-metadata==8.6.1
      - iniconfig==2.1.0
      - jarn-viewdoc==2.7
      - jinja2==3.1.6
      - markupsafe==3.0.2
      - mypy-extensions==1.0.0
      - olefile==0.47
      - packaging==24.2
      - pathspec==0.12.1
      - platformdirs==4.3.7
      - pluggy==1.5.0
      - pycodestyle==2.13.0
      - pyflakes==3.3.1
      - pygments==2.19.1
      - pyproject-hooks==1.2.0
      - pyroma==4.2
      - pytest==8.3.5
      - pytest-cov==6.0.0
      - requests==2.32.3
      - six==1.17.0
      - snowballstemmer==2.2.0
      - sphinx==7.4.7
      - sphinx-rtd-theme==3.0.2
      - sphinxcontrib-applehelp==2.0.0
      - sphinxcontrib-devhelp==2.0.0
      - sphinxcontrib-htmlhelp==2.1.0
      - sphinxcontrib-jquery==4.1
      - sphinxcontrib-jsmath==1.0.1
      - sphinxcontrib-qthelp==2.0.0
      - sphinxcontrib-serializinghtml==2.0.0
      - tomli==2.2.1
      - trove-classifiers==2025.3.19.19
      - typing-extensions==4.13.0
      - urllib3==2.3.0
      - wcwidth==0.2.13
      - zipp==3.21.0
prefix: /opt/conda/envs/Pillow

Tests/test_imagedraw.py::test_line_joint[xy1] Tests/test_imagedraw.py::test_line_joint[xy2]
Tests/test_imagedraw.py::test_sanity Tests/test_imagedraw.py::test_valueerror Tests/test_imagedraw.py::test_mode_mismatch Tests/test_imagedraw.py::test_arc1 Tests/test_imagedraw.py::test_arc2 Tests/test_imagedraw.py::test_arc_end_le_start Tests/test_imagedraw.py::test_arc_no_loops Tests/test_imagedraw.py::test_arc_width Tests/test_imagedraw.py::test_arc_width_pieslice_large Tests/test_imagedraw.py::test_arc_width_fill Tests/test_imagedraw.py::test_arc_width_non_whole_angle Tests/test_imagedraw.py::test_bitmap Tests/test_imagedraw.py::test_chord1 Tests/test_imagedraw.py::test_chord2 Tests/test_imagedraw.py::test_chord_width Tests/test_imagedraw.py::test_chord_width_fill Tests/test_imagedraw.py::test_chord_zero_width Tests/test_imagedraw.py::test_ellipse1 Tests/test_imagedraw.py::test_ellipse2 Tests/test_imagedraw.py::test_ellipse_translucent Tests/test_imagedraw.py::test_ellipse_edge Tests/test_imagedraw.py::test_ellipse_symmetric Tests/test_imagedraw.py::test_ellipse_width Tests/test_imagedraw.py::test_ellipse_width_large Tests/test_imagedraw.py::test_ellipse_width_fill Tests/test_imagedraw.py::test_ellipse_zero_width Tests/test_imagedraw.py::test_line1 Tests/test_imagedraw.py::test_line2 Tests/test_imagedraw.py::test_shape1 Tests/test_imagedraw.py::test_shape2 Tests/test_imagedraw.py::test_pieslice1 Tests/test_imagedraw.py::test_pieslice2 Tests/test_imagedraw.py::test_pieslice_width Tests/test_imagedraw.py::test_pieslice_width_fill Tests/test_imagedraw.py::test_pieslice_zero_width Tests/test_imagedraw.py::test_point1 Tests/test_imagedraw.py::test_point2 Tests/test_imagedraw.py::test_polygon1 Tests/test_imagedraw.py::test_polygon2 Tests/test_imagedraw.py::test_polygon_kite Tests/test_imagedraw.py::test_rectangle1 Tests/test_imagedraw.py::test_rectangle2 Tests/test_imagedraw.py::test_big_rectangle Tests/test_imagedraw.py::test_rectangle_width Tests/test_imagedraw.py::test_rectangle_width_fill Tests/test_imagedraw.py::test_rectangle_zero_width Tests/test_imagedraw.py::test_rectangle_I16 Tests/test_imagedraw.py::test_floodfill Tests/test_imagedraw.py::test_floodfill_border Tests/test_imagedraw.py::test_floodfill_thresh Tests/test_imagedraw.py::test_floodfill_not_negative Tests/test_imagedraw.py::test_square Tests/test_imagedraw.py::test_triangle_right Tests/test_imagedraw.py::test_line_horizontal Tests/test_imagedraw.py::test_line_vertical Tests/test_imagedraw.py::test_line_oblique_45 Tests/test_imagedraw.py::test_wide_line_dot Tests/test_imagedraw.py::test_line_joint[xy0] Tests/test_imagedraw.py::test_textsize_empty_string Tests/test_imagedraw.py::test_textsize_stroke Tests/test_imagedraw.py::test_stroke Tests/test_imagedraw.py::test_stroke_descender Tests/test_imagedraw.py::test_stroke_multiline Tests/test_imagedraw.py::test_same_color_outline
src/PIL/ImageDraw.py
src/PIL/ImageDraw.py