### ImageMagick version

7.1.1-15_1

### Operating system

MacOS

### Operating system, version and so on

Ventura 13.2 Intel Core i7

### Description

I am using ImageMagick to convert from PDF to a raster image format such as JPG or TIFF.

When I use GhostScript directly, e.g. with:
`gs -sDEVICE=jpeg -o rastered_img_gs.jpg -r600x600 mypdf.pdf`
or
`gs -sDEVICE=tiff24nc -o rastered_img_gs.tiff -r600x600 mypdf.pdf`

The output looks ok. However, if I use ImageMagick, e.g. with:
`convert -density 600 mypdf.pdf rastered_img_im.jpg`
or
`convert -density 600 mypdf.pdf rastered_img_im.tiff`

Some weird lines appear on various normally-plain colour areas, as depicted on the images below.

---

I also had the same issue with PNG or BMP formats... I ended up using `pdftoppm` which works fine (or I could have stuck with GhostScript).

### Steps to Reproduce

I made this minimal working example in Tikz to show the issue at hand, LaTeX code:

```latex
\documentclass[tikz]{standalone}
\usepackage{pgfplots}
\pgfplotsset{width=8cm, height=7cm, compat=1.18}
\usepackage{tikz}
\newcommand{\mytau}{0.075}

\begin{document}
	
	\begin{tikzpicture}
		\begin{axis}[xmin=0, xmax=10, ymin=0, ymax=1]
			\addplot[color=black,line cap=round,
			domain=0:5,
			samples=200,
			line width=5pt,
			]{1-exp(-\mytau*x)};
			\addplot[forget plot, color=black,line cap=round,
			domain=5:10,
			samples=200,
			line width=5pt,
			]{1-exp(-2*\mytau*(x-5))+1-exp(-\mytau*5)};
			\addplot[color=blue, line cap=round,
			domain=0:10,
			samples=200,
			line width=2pt,
			]{1-exp(-\mytau*x)};
			\addplot[color=red, line cap=round,
			domain=5:10,
			samples=200,
			line width=2pt,,
			]{1-exp(-2*\mytau*(x-5))+1-exp(-5*\mytau)};
		\end{axis}
	\end{tikzpicture}
\end{document}
```

Compile using `lualatex mwe.tex`, which should produce a `mwe.pdf` file.

Using Ghostscript works fine using either of these commands:

```bash
gs -sDEVICE=jpeg -o rastered_img_gs.jpg -r600x600 mwe.pdf
gs -sDEVICE=tiff24nc -o rastered_img_gs.tiff -r600x600 mwe.pdf
```

However, using ImageMagick with:

```bash
convert -density 600 mwe.pdf rastered_img_im.jpg
convert -density 600 mwe.pdf rastered_img_im.tiff
```

Yields horrible horizontal lines...

### Images

PDF version is clean:
![image](https://github.com/ImageMagick/ImageMagick/assets/17085178/1d6aee7e-5e1b-4f43-914e-7562383c2c5c)
Ghostscript JPG is also clean (apart from the crappy JPG compression of course):
![image](https://github.com/ImageMagick/ImageMagick/assets/17085178/a19e6eae-8668-401b-93b6-158bbb137b04)
ImageMagick version has some weird horizontal lines:
![image](https://github.com/ImageMagick/ImageMagick/assets/17085178/7eb83896-ef29-40fb-beae-a9db27fd6c00)

PDF to JPG / TIFF adds some weird horizontal lines
This is a GitHub Issue
repo:ImageMagick
owner:ImageMagick
Title : PDF to JPG / TIFF adds some weird horizontal lines
Issue date:

--- start body ---
### ImageMagick version

7.1.1-15_1

### Operating system

MacOS

### Operating system, version and so on

Ventura 13.2 Intel Core i7

### Description

I am using ImageMagick to convert from PDF to a raster image format such as JPG or TIFF.

When I use GhostScript directly, e.g. with:
`gs -sDEVICE=jpeg -o rastered_img_gs.jpg -r600x600 mypdf.pdf`
or
`gs -sDEVICE=tiff24nc -o rastered_img_gs.tiff -r600x600 mypdf.pdf`

The output looks ok. However, if I use ImageMagick, e.g. with:
`convert -density 600 mypdf.pdf rastered_img_im.jpg`
or
`convert -density 600 mypdf.pdf rastered_img_im.tiff`

Some weird lines appear on various normally-plain colour areas, as depicted on the images below.

---

I also had the same issue with PNG or BMP formats... I ended up using `pdftoppm` which works fine (or I could have stuck with GhostScript).

### Steps to Reproduce

I made this minimal working example in Tikz to show the issue at hand, LaTeX code:

```latex
\documentclass[tikz]{standalone}
\usepackage{pgfplots}
\pgfplotsset{width=8cm, height=7cm, compat=1.18}
\usepackage{tikz}
\newcommand{\mytau}{0.075}

\begin{document}
	
	\begin{tikzpicture}
		\begin{axis}[xmin=0, xmax=10, ymin=0, ymax=1]
			\addplot[color=black,line cap=round,
			domain=0:5,
			samples=200,
			line width=5pt,
			]{1-exp(-\mytau*x)};
			\addplot[forget plot, color=black,line cap=round,
			domain=5:10,
			samples=200,
			line width=5pt,
			]{1-exp(-2*\mytau*(x-5))+1-exp(-\mytau*5)};
			\addplot[color=blue, line cap=round,
			domain=0:10,
			samples=200,
			line width=2pt,
			]{1-exp(-\mytau*x)};
			\addplot[color=red, line cap=round,
			domain=5:10,
			samples=200,
			line width=2pt,,
			]{1-exp(-2*\mytau*(x-5))+1-exp(-5*\mytau)};
		\end{axis}
	\end{tikzpicture}
\end{document}
```

Compile using `lualatex mwe.tex`, which should produce a `mwe.pdf` file.

Using Ghostscript works fine using either of these commands:

```bash
gs -sDEVICE=jpeg -o rastered_img_gs.jpg -r600x600 mwe.pdf
gs -sDEVICE=tiff24nc -o rastered_img_gs.tiff -r600x600 mwe.pdf
```

However, using ImageMagick with:

```bash
convert -density 600 mwe.pdf rastered_img_im.jpg
convert -density 600 mwe.pdf rastered_img_im.tiff
```

Yields horrible horizontal lines...

### Images

PDF version is clean:
![image](https://github.com/ImageMagick/ImageMagick/assets/17085178/1d6aee7e-5e1b-4f43-914e-7562383c2c5c)
Ghostscript JPG is also clean (apart from the crappy JPG compression of course):
![image](https://github.com/ImageMagick/ImageMagick/assets/17085178/a19e6eae-8668-401b-93b6-158bbb137b04)
ImageMagick version has some weird horizontal lines:
![image](https://github.com/ImageMagick/ImageMagick/assets/17085178/7eb83896-ef29-40fb-beae-a9db27fd6c00)

--- end body ---

None