0

I'm writing a graphic app in PHP. I'm using the GD function imagecopy() to combine two images, one smaller than the other. I want to position the smaller image on top of the bigger image in a float point position. Like this:

imagecopy($bg,$front,30.7,15.2,0,0,100,100);

The function receives Integers, so my coordinates are automatically being rounded up or down. This is important to me as I'm creating a delicate animation and the rounding of the float values messes it up. Is there a way to draw the image in it's float point position?

Thank you.

David Walschots
  • 12,279
  • 5
  • 36
  • 59
dan
  • 11
  • 3
  • Those parameters are defined as INT so not with that function – RiggsFolly Aug 31 '18 at 14:22
  • 2
    Images are drawn with pixels on your screen. 0.7 or 0.2 pixel makes no sense as they don't exist. There is no such thing as half a pixel – jrswgtr Aug 31 '18 at 14:23
  • @dan do you work with tiny images ? Are you sure you need to be precise at 1/10 of a pixel ? Just that you don't loose your mind on an XY problem. – AymDev Aug 31 '18 at 14:23
  • Moving images by sub-pixel can create some unwanted blurring, or other anomalies. Unless working with retina images, its best to stick with the 1 to 1 relation of movement. – IncredibleHat Aug 31 '18 at 14:28

0 Answers0