In the following PostScript file resource, there is already an image which displays correctly, but I need to replace it with a new image. I have the new image in JPEG format, and I use this tool https://capitalizemytitle.com/image-to-hex-converter/ to convert it to hexadecimal format.
After obtaining the hexadecimal value and replacing the existing hexadecimal code in the PostScript file (right after /Decode[0 1]/DataSource), the image doesn’t display correctly in the PDF file generated by Ghostscript. This is how the image looks like.
Original Image:
I have also attached the working postscript resource file with the image data.
What could be going wrong? Also, what is the correct way to generate a hexadecimal value for use in this PostScript file?
`%%BeginResource: file TestSignature150pix.jpg 1 0
/GroupExecutive.form
<<
/FormType 1
/BBox[0 0 139 82]
/Matrix[1 0 0 1 0 0]
/PaintProc{pop
/DeviceGray setcolorspace gsave
102.30 42.91 scale
<<
/Interpolate true
/ImageType 1
/Width 317
/Height 133
/ImageMatrix[317 0 0 -133 0 133]
/BitsPerComponent 8
/Decode[0 1]/DataSource
<d5ff00fdffff00fcfbfefbff00fefcff00fcffff01fcfef9ff02fefffefeff
05fefdfefffdfcfffffffc02fffcfefcff00feffff01fafbffff00fdfeff00
fdfffbffff00fab6ff04fdfffefffcffff00fbfeff01fefdffff01fcfdffff
00fdffff00fbfeff05fbf9fffafefffffdffff00fcfdff00feffff00fdfeff
01fcfefeff00fdfffefeff00fd9bff00fefbff00fcfaff00feffff02fefdfe
feff01fbfdfffefefffffdfeff01fdfcfffffffd03fbfafcfeffff01fefdf8
ff02fcfbfeffff01fefbffff06f7fbfffdfefffaffff01f4fdb8ff07fefdff
fafff7fffbfdff02fbfffdffff10fce4c7b4a28c7f8595bcc4bb9c87818a86
ff840085ff861187868281807f8babccf6fff6cdbcc7e3fffeffff01fcfeff....`