GD ใŠใ‚ˆใณ Image ้–ขๆ•ฐ

็›ฎๆฌก

  • gd_info โ€” ็พๅœจใ‚คใƒณใ‚นใƒˆใƒผใƒซใ•ใ‚Œใฆใ„ใ‚‹GDใƒฉใ‚คใƒ–ใƒฉใƒชใซ้–ขใ™ใ‚‹ๆƒ…ๅ ฑใ‚’ๅ–ๅพ—ใ™ใ‚‹
  • getimagesize โ€” ็”ปๅƒใฎๅคงใใ•ใ‚’ๅ–ๅพ—ใ™ใ‚‹
  • getimagesizefromstring โ€” ็”ปๅƒใฎๅคงใใ•ใ‚’ๆ–‡ๅญ—ๅˆ—ใ‹ใ‚‰ๅ–ๅพ—ใ™ใ‚‹
  • image_type_to_extension โ€” ็”ปๅƒๅฝขๅผใ‹ใ‚‰ใƒ•ใ‚กใ‚คใƒซใฎๆ‹กๅผตๅญใ‚’ๅ–ๅพ—ใ™ใ‚‹
  • image_type_to_mime_type โ€” getimagesize, exif_read_data, exif_thumbnail, exif_imagetypeใ‹ใ‚‰่ฟ”ใ•ใ‚Œใ‚‹ ็”ปๅƒๅฝขๅผใฎMIMEใ‚ฟใ‚คใƒ—ใ‚’ๅ–ๅพ—ใ™ใ‚‹
  • image2wbmp โ€” ็”ปๅƒใ‚’ใƒ–ใƒฉใ‚ฆใ‚ถใ‚ใ‚‹ใ„ใฏใƒ•ใ‚กใ‚คใƒซใซๅ‡บๅŠ›ใ™ใ‚‹
  • imageaffine โ€” ๅ…ƒใฎ็”ปๅƒใ‚’ใ€ใ‚ชใƒ—ใ‚ทใƒงใƒณใฎใ‚ฏใƒชใƒƒใƒ”ใƒณใ‚ฐ้ ˜ๅŸŸใ‚’ไฝฟใฃใฆใ‚ขใƒ•ใ‚ฃใƒณๅค‰ๆ›ใ—ใŸ็”ปๅƒใ‚’่ฟ”ใ™
  • imageaffinematrixconcat โ€” ไบŒใคใฎใ‚ขใƒ•ใ‚ฃใƒณๅค‰ๆ›่กŒๅˆ—ใ‚’้€ฃ็ตใ™ใ‚‹
  • imageaffinematrixget โ€” ใ‚ขใƒ•ใ‚ฃใƒณๅค‰ๆ›่กŒๅˆ—ใ‚’ๅ–ๅพ—ใ™ใ‚‹
  • imagealphablending โ€” ใ‚คใƒกใƒผใ‚ธใฎใƒ–ใƒฌใƒณใƒ‰ใƒขใƒผใƒ‰ใ‚’่จญๅฎšใ™ใ‚‹
  • imageantialias โ€” ใ‚ขใƒณใƒใ‚จใ‚คใƒชใ‚ขใ‚นๆฉŸ่ƒฝใ‚’ไฝฟ็”จใ™ในใใ‹ใฉใ†ใ‹ใ‚’ๅˆคๆ–ญใ™ใ‚‹
  • imagearc โ€” ้ƒจๅˆ†ๆฅ•ๅ††ใ‚’ๆ็”ปใ™ใ‚‹
  • imageavif โ€” ็”ปๅƒใ‚’ใƒ–ใƒฉใ‚ฆใ‚ถใ‚ใ‚‹ใ„ใฏใƒ•ใ‚กใ‚คใƒซใซๅ‡บๅŠ›ใ™ใ‚‹
  • imagebmp โ€” ใƒ“ใƒƒใƒˆใƒžใƒƒใƒ—็”ปๅƒใ‚’ใƒ–ใƒฉใ‚ฆใ‚ถใ‹ใƒ•ใ‚กใ‚คใƒซใซๅ‡บๅŠ›ใ™ใ‚‹
  • imagechar โ€” ๆฐดๅนณใซๆ–‡ๅญ—ใ‚’ๆ็”ปใ™ใ‚‹
  • imagecharup โ€” ๅž‚็›ดใซๆ–‡ๅญ—ใ‚’ๆ็”ปใ™ใ‚‹
  • imagecolorallocate โ€” ็”ปๅƒใงไฝฟ็”จใ™ใ‚‹่‰ฒใ‚’ไฝœๆˆใ™ใ‚‹
  • imagecolorallocatealpha โ€” ็”ปๅƒใงไฝฟ็”จใ™ใ‚‹่‰ฒใ‚’้€้Žๅบฆใ‚’ๆŒ‡ๅฎšใ—ใฆไฝœๆˆใ™ใ‚‹
  • imagecolorat โ€” ใƒ”ใ‚ฏใ‚ปใƒซใฎ่‰ฒใฎใ‚คใƒณใƒ‡ใƒƒใ‚ฏใ‚นใ‚’ๅ–ๅพ—ใ™ใ‚‹
  • imagecolorclosest โ€” ๆŒ‡ๅฎšใ—ใŸ่‰ฒใซๆœ€ใ‚‚่ฟ‘ใ„่‰ฒใฎใ‚คใƒณใƒ‡ใƒƒใ‚ฏใ‚นใ‚’ๅ–ๅพ—ใ™ใ‚‹
  • imagecolorclosestalpha โ€” ๆŒ‡ๅฎšใ—ใŸ่‰ฒ+ใ‚ขใƒซใƒ•ใ‚กๅ€คใซๆœ€ใ‚‚่ฟ‘ใ„่‰ฒใฎใ‚คใƒณใƒ‡ใƒƒใ‚ฏใ‚นใ‚’ๅ–ๅพ—ใ™ใ‚‹
  • imagecolorclosesthwb โ€” ่‰ฒๅˆใ„ใ€็™ฝใ€้ป’ใ‚’ๆœ‰ใ™ใ‚‹่‰ฒใฎใ‚คใƒณใƒ‡ใƒƒใ‚ฏใ‚นใ‚’ๅพ—ใ‚‹
  • imagecolordeallocate โ€” ใ‚คใƒกใƒผใ‚ธใฎ่‰ฒใƒชใ‚ฝใƒผใ‚นใ‚’้–‹ๆ”พใ™ใ‚‹
  • imagecolorexact โ€” ๆŒ‡ๅฎšใ—ใŸ่‰ฒใฎใ‚คใƒณใƒ‡ใƒƒใ‚ฏใ‚นใ‚’ๅ–ๅพ—ใ™ใ‚‹
  • imagecolorexactalpha โ€” ๆŒ‡ๅฎšใ—ใŸ่‰ฒ+ใ‚ขใƒซใƒ•ใ‚กๅ€คใฎใ‚คใƒณใƒ‡ใƒƒใ‚ฏใ‚นใ‚’ๅ–ๅพ—ใ™ใ‚‹
  • imagecolormatch โ€” ใƒ‘ใƒฌใƒƒใƒˆใ‚คใƒกใƒผใ‚ธใฎ่‰ฒใ‚’ True ใ‚ซใƒฉใƒผใ‚คใƒกใƒผใ‚ธใซ่ฟ‘ใฅใ‘ใ‚‹
  • imagecolorresolve โ€” ๆŒ‡ๅฎšใ—ใŸ่‰ฒใพใŸใฏๅ‡บๆฅใ‚‹ใ ใ‘่ฟ‘ใ„่‰ฒใฎใ‚คใƒณใƒ‡ใƒƒใ‚ฏใ‚นใ‚’ๅพ—ใ‚‹
  • imagecolorresolvealpha โ€” ๆŒ‡ๅฎšใ—ใŸ่‰ฒ+ใ‚ขใƒซใƒ•ใ‚กๅ€คใพใŸใฏๆœ€ใ‚‚่ฟ‘ใ„่‰ฒใฎใ‚คใƒณใƒ‡ใƒƒใ‚ฏใ‚นใ‚’ๅ–ๅพ—ใ™ใ‚‹
  • imagecolorset โ€” ๆŒ‡ๅฎšใ—ใŸใƒ‘ใƒฌใƒƒใƒˆใ‚คใƒณใƒ‡ใƒƒใ‚ฏใ‚นใฎ่‰ฒใ‚’่จญๅฎšใ™ใ‚‹
  • imagecolorsforindex โ€” ใ‚ซใƒฉใƒผใ‚คใƒณใƒ‡ใƒƒใ‚ฏใ‚นใ‹ใ‚‰ใ‚ซใƒฉใƒผใ‚’ๅ–ๅพ—ใ™ใ‚‹
  • imagecolorstotal โ€” ็”ปๅƒใƒ‘ใƒฌใƒƒใƒˆใฎ่‰ฒๆ•ฐใ‚’ๆคœๅ‡บใ™ใ‚‹
  • imagecolortransparent โ€” ้€ๆ˜Ž่‰ฒใ‚’ๅฎš็พฉใ™ใ‚‹
  • imageconvolution โ€” div ใŠใ‚ˆใณ offset ใฎไฟ‚ๆ•ฐใ‚’ไฝฟ็”จใ—ใ€3x3 ใฎ็•ณใฟ่พผใฟ้…ๅˆ—ใ‚’้ฉ็”จใ™ใ‚‹
  • imagecopy โ€” ็”ปๅƒใฎไธ€้ƒจใ‚’ใ‚ณใƒ”ใƒผใ™ใ‚‹
  • imagecopymerge โ€” ใ‚คใƒกใƒผใ‚ธใฎไธ€้ƒจใ‚’ใ‚ณใƒ”ใƒผใ€ใƒžใƒผใ‚ธใ™ใ‚‹
  • imagecopymergegray โ€” ใ‚ฐใƒฌใƒผใ‚นใ‚ฑใƒผใƒซใงใ‚คใƒกใƒผใ‚ธใฎไธ€้ƒจใ‚’ใ‚ณใƒ”ใƒผใ€ใƒžใƒผใ‚ธใ™ใ‚‹
  • imagecopyresampled โ€” ๅ†ใ‚ตใƒณใƒ—ใƒชใƒณใ‚ฐใ‚’่กŒใ„ใ‚คใƒกใƒผใ‚ธใฎไธ€้ƒจใ‚’ใ‚ณใƒ”ใƒผใ€ไผธ็ธฎใ™ใ‚‹
  • imagecopyresized โ€” ็”ปๅƒใฎไธ€้ƒจใ‚’ใ‚ณใƒ”ใƒผใ—ใ‚ตใ‚คใ‚บใ‚’ๅค‰ๆ›ดใ™ใ‚‹
  • imagecreate โ€” ใƒ‘ใƒฌใƒƒใƒˆใ‚’ไฝฟ็”จใ™ใ‚‹ๆ–ฐ่ฆ็”ปๅƒใ‚’ไฝœๆˆใ™ใ‚‹
  • imagecreatefromavif โ€” ๆ–ฐใ—ใ„็”ปๅƒใ‚’ใƒ•ใ‚กใ‚คใƒซใ‚ใ‚‹ใ„ใฏ URL ใ‹ใ‚‰ไฝœๆˆใ™ใ‚‹
  • imagecreatefrombmp โ€” ๆ–ฐใ—ใ„็”ปๅƒใ‚’ใƒ•ใ‚กใ‚คใƒซใ‚ใ‚‹ใ„ใฏ URL ใ‹ใ‚‰ไฝœๆˆใ™ใ‚‹
  • imagecreatefromgd โ€” GD ใƒ•ใ‚กใ‚คใƒซใพใŸใฏ URL ใ‹ใ‚‰ๆ–ฐ่ฆใ‚คใƒกใƒผใ‚ธใ‚’็”Ÿๆˆใ™ใ‚‹
  • imagecreatefromgd2 โ€” GD2 ใƒ•ใ‚กใ‚คใƒซใพใŸใฏ URL ใ‹ใ‚‰ๆ–ฐ่ฆใ‚คใƒกใƒผใ‚ธใ‚’็”Ÿๆˆใ™ใ‚‹
  • imagecreatefromgd2part โ€” GD2 ใƒ•ใ‚กใ‚คใƒซใพใŸใฏ URL ใฎๆŒ‡ๅฎšใ—ใŸ้ƒจๅˆ†ใ‹ใ‚‰ๆ–ฐ่ฆใ‚คใƒกใƒผใ‚ธใ‚’็”Ÿๆˆใ™ใ‚‹
  • imagecreatefromgif โ€” ๆ–ฐใ—ใ„็”ปๅƒใ‚’ใƒ•ใ‚กใ‚คใƒซใ‚ใ‚‹ใ„ใฏ URL ใ‹ใ‚‰ไฝœๆˆใ™ใ‚‹
  • imagecreatefromjpeg โ€” ๆ–ฐใ—ใ„็”ปๅƒใ‚’ใƒ•ใ‚กใ‚คใƒซใ‚ใ‚‹ใ„ใฏ URL ใ‹ใ‚‰ไฝœๆˆใ™ใ‚‹
  • imagecreatefrompng โ€” ๆ–ฐใ—ใ„็”ปๅƒใ‚’ใƒ•ใ‚กใ‚คใƒซใ‚ใ‚‹ใ„ใฏ URL ใ‹ใ‚‰ไฝœๆˆใ™ใ‚‹
  • imagecreatefromstring โ€” ๆ–‡ๅญ—ๅˆ—ใฎไธญใฎใ‚คใƒกใƒผใ‚ธใ‚นใƒˆใƒชใƒผใƒ ใ‹ใ‚‰ๆ–ฐ่ฆใ‚คใƒกใƒผใ‚ธใ‚’ไฝœๆˆใ™ใ‚‹
  • imagecreatefromtga โ€” ๆ–ฐใ—ใ„็”ปๅƒใ‚’ใƒ•ใ‚กใ‚คใƒซใ‚ใ‚‹ใ„ใฏ URL ใ‹ใ‚‰ไฝœๆˆใ™ใ‚‹
  • imagecreatefromwbmp โ€” ๆ–ฐใ—ใ„็”ปๅƒใ‚’ใƒ•ใ‚กใ‚คใƒซใ‚ใ‚‹ใ„ใฏ URL ใ‹ใ‚‰ไฝœๆˆใ™ใ‚‹
  • imagecreatefromwebp โ€” ๆ–ฐใ—ใ„็”ปๅƒใ‚’ใƒ•ใ‚กใ‚คใƒซใ‚ใ‚‹ใ„ใฏ URL ใ‹ใ‚‰ไฝœๆˆใ™ใ‚‹
  • imagecreatefromxbm โ€” ๆ–ฐใ—ใ„็”ปๅƒใ‚’ใƒ•ใ‚กใ‚คใƒซใ‚ใ‚‹ใ„ใฏ URL ใ‹ใ‚‰ไฝœๆˆใ™ใ‚‹
  • imagecreatefromxpm โ€” ๆ–ฐใ—ใ„็”ปๅƒใ‚’ใƒ•ใ‚กใ‚คใƒซใ‚ใ‚‹ใ„ใฏ URL ใ‹ใ‚‰ไฝœๆˆใ™ใ‚‹
  • imagecreatetruecolor โ€” TrueColor ใ‚คใƒกใƒผใ‚ธใ‚’ๆ–ฐ่ฆใซไฝœๆˆใ™ใ‚‹
  • imagecrop โ€” ๆŒ‡ๅฎšใ—ใŸ็Ÿฉๅฝขใซ็”ปๅƒใ‚’ใ‚ฏใƒญใƒƒใƒ—ใ™ใ‚‹
  • imagecropauto โ€” ๅˆฉ็”จๅฏ่ƒฝใชใƒขใƒผใƒ‰ใ‚’ๆŒ‡ๅฎšใ—ใฆใ€็”ปๅƒใ‚’่‡ชๅ‹•็š„ใซใ‚ฏใƒญใƒƒใƒ—ใ™ใ‚‹
  • imagedashedline โ€” ็ ด็ทšใ‚’ๆ็”ปใ™ใ‚‹
  • imagedestroy โ€” ็”ปๅƒใ‚’็ ดๆฃ„ใ™ใ‚‹
  • imageellipse โ€” ๆฅ•ๅ††ใ‚’ๆ็”ปใ™ใ‚‹
  • imagefill โ€” ๅก—ใ‚Šๆฝฐใ™
  • imagefilledarc โ€” ๆฅ•ๅ††ๅผงใ‚’ๆ็”ปใ—ใ€ๅก—ใ‚Šใคใถใ™
  • imagefilledellipse โ€” ๅก—ใ‚Šใคใถใ•ใ‚ŒใŸๆฅ•ๅ††ใ‚’ๆ็”ปใ™ใ‚‹
  • imagefilledpolygon โ€” ๅก—ใ‚Šใคใถใ—ใŸๅคš่ง’ๅฝขใ‚’ๆ็”ปใ™ใ‚‹
  • imagefilledrectangle โ€” ๅก—ใ‚Šใคใถใ—ใŸ็Ÿฉๅฝขใ‚’ๆ็”ปใ™ใ‚‹
  • imagefilltoborder โ€” ็‰นๅฎš่‰ฒใงๅก—ใ‚Šใคใถใ™
  • imagefilter โ€” ็”ปๅƒใซใƒ•ใ‚ฃใƒซใ‚ฟใ‚’้ฉ็”จใ™ใ‚‹
  • imageflip โ€” ๆŒ‡ๅฎšใ—ใŸใƒขใƒผใƒ‰ใง็”ปๅƒใ‚’ๅ่ปขใ•ใ›ใ‚‹
  • imagefontheight โ€” ใƒ•ใ‚ฉใƒณใƒˆใฎ้ซ˜ใ•ใ‚’ๅ–ๅพ—ใ™ใ‚‹
  • imagefontwidth โ€” ใƒ•ใ‚ฉใƒณใƒˆใฎๅน…ใ‚’ๅ–ๅพ—ใ™ใ‚‹
  • imageftbbox โ€” freetype2 ใซใ‚ˆใ‚‹ใƒ•ใ‚ฉใƒณใƒˆใ‚’็”จใ„ใŸใƒ†ใ‚ญใ‚นใƒˆใ‚’ๅ›ฒใ‚€็ฎฑใ‚’ๅ–ๅพ—ใ™ใ‚‹
  • imagefttext โ€” FreeType 2 ใซใ‚ˆใ‚‹ใƒ•ใ‚ฉใƒณใƒˆใ‚’็”จใ„ใฆใ‚คใƒกใƒผใ‚ธใซใƒ†ใ‚ญใ‚นใƒˆใ‚’ๆ็”ปใ™ใ‚‹
  • imagegammacorrect โ€” GD ใ‚คใƒกใƒผใ‚ธใซใ‚ฌใƒณใƒž่ฃœๆญฃใ‚’้ฉ็”จใ™ใ‚‹
  • imagegd โ€” GD ใ‚คใƒกใƒผใ‚ธใ‚’ใƒ–ใƒฉใ‚ฆใ‚ถใพใŸใฏใƒ•ใ‚กใ‚คใƒซใซๅ‡บๅŠ›ใ™ใ‚‹
  • imagegd2 โ€” GD2 ใ‚คใƒกใƒผใ‚ธใ‚’ใƒ–ใƒฉใ‚ฆใ‚ถใพใŸใฏใƒ•ใ‚กใ‚คใƒซใซๅ‡บๅŠ›ใ™ใ‚‹
  • imagegetclip โ€” ้•ทๆ–นๅฝขใ‚’ๅˆ‡ใ‚Šๅ–ใ‚Šใ€็”ปๅƒใจใ—ใฆๅ–ๅพ—ใ™ใ‚‹
  • imagegetinterpolation โ€” ่ฃœ้–“ๆ–นๆณ•ใ‚’ๅ–ๅพ—ใ™ใ‚‹
  • imagegif โ€” ็”ปๅƒใ‚’ใƒ–ใƒฉใ‚ฆใ‚ถใ‚ใ‚‹ใ„ใฏใƒ•ใ‚กใ‚คใƒซใซๅ‡บๅŠ›ใ™ใ‚‹
  • imagegrabscreen โ€” ็”ป้ขๅ…จไฝ“ใ‚’ใ‚ญใƒฃใƒ—ใƒใƒฃใ™ใ‚‹
  • imagegrabwindow โ€” ใ‚ฆใ‚ฃใƒณใƒ‰ใ‚ฆใ‚’ใ‚ญใƒฃใƒ—ใƒใƒฃใ™ใ‚‹
  • imageinterlace โ€” ใ‚คใƒณใ‚ฟใƒผใƒฌใƒผใ‚นใ‚’ๆœ‰ๅŠนใ‚‚ใ—ใใฏ็„กๅŠนใซใ™ใ‚‹
  • imageistruecolor โ€” ็”ปๅƒใŒ truecolor ใ‹ใฉใ†ใ‹่ชฟในใ‚‹
  • imagejpeg โ€” ็”ปๅƒใ‚’ใƒ–ใƒฉใ‚ฆใ‚ถใ‚ใ‚‹ใ„ใฏใƒ•ใ‚กใ‚คใƒซใซๅ‡บๅŠ›ใ™ใ‚‹
  • imagelayereffect โ€” ใ‚ขใƒซใƒ•ใ‚กใƒ–ใƒฌใƒณใƒ‡ใ‚ฃใƒณใ‚ฐใƒ•ใƒฉใ‚ฐใ‚’่จญๅฎšใ—ใ€ใƒฌใ‚คใƒคๅŠนๆžœใ‚’ไฝฟ็”จใ™ใ‚‹
  • imageline โ€” ็›ด็ทšใ‚’ๆ็”ปใ™ใ‚‹
  • imageloadfont โ€” ๆ–ฐใ—ใ„ใƒ•ใ‚ฉใƒณใƒˆใ‚’่ชญใฟ่พผใ‚€
  • imageopenpolygon โ€” ใ‚ชใƒผใƒ—ใƒณใƒใƒชใ‚ดใƒณใ‚’ๆ็”ปใ™ใ‚‹
  • imagepalettecopy โ€” ใ‚ใ‚‹ใ‚คใƒกใƒผใ‚ธใ‹ใ‚‰ไป–ใฎใ‚คใƒกใƒผใ‚ธใซใƒ‘ใƒฌใƒƒใƒˆใ‚’ใ‚ณใƒ”ใƒผใ™ใ‚‹
  • imagepalettetotruecolor โ€” ใƒ‘ใƒฌใƒƒใƒˆๅฝขๅผใฎ็”ปๅƒใ‚’ true color ใซๅค‰ๆ›ใ™ใ‚‹
  • imagepng โ€” PNG ใ‚คใƒกใƒผใ‚ธใ‚’ใƒ–ใƒฉใ‚ฆใ‚ถใพใŸใฏใƒ•ใ‚กใ‚คใƒซใซๅ‡บๅŠ›ใ™ใ‚‹
  • imagepolygon โ€” ๅคš่ง’ๅฝขใ‚’ๆ็”ปใ™ใ‚‹
  • imagerectangle โ€” ็Ÿฉๅฝขใ‚’ๆ็”ปใ™ใ‚‹
  • imageresolution โ€” ็”ปๅƒใฎ่งฃๅƒๅบฆใ‚’ๅ–ๅพ—/่จญๅฎšใ™ใ‚‹
  • imagerotate โ€” ๆŒ‡ๅฎšใ•ใ‚ŒใŸ่ง’ๅบฆใง็”ปๅƒใ‚’ๅ›ž่ปขใ™ใ‚‹
  • imagesavealpha โ€” ็”ปๅƒใ‚’ไฟๅญ˜ใ™ใ‚‹้š›ใซใ€ๅฎŒๅ…จใชใ‚ขใƒซใƒ•ใ‚กใƒใƒฃใƒใƒซๆƒ…ๅ ฑใ‚’ไฟๅญ˜ใ™ใ‚‹ใ‹ใฉใ†ใ‹ใ‚’ๆŒ‡ๅฎšใ™ใ‚‹
  • imagescale โ€” ๅน…ใจ้ซ˜ใ•ใ‚’ๆŒ‡ๅฎšใ—ใฆใ€็”ปๅƒใฎ็ธฎๅฐบใ‚’ๅค‰ๆ›ดใ™ใ‚‹
  • imagesetbrush โ€” ็ทšใฎๆ็”ป็”จใซใƒ–ใƒฉใ‚ทใ‚คใƒกใƒผใ‚ธใ‚’่จญๅฎšใ™ใ‚‹
  • imagesetclip โ€” ๅˆ‡ใ‚Šๅ–ใ‚‹้•ทๆ–นๅฝขใ‚’่จญๅฎšใ™ใ‚‹
  • imagesetinterpolation โ€” ่ฃœ้–“ๆ–นๆณ•ใ‚’่จญๅฎšใ™ใ‚‹
  • imagesetpixel โ€” ็‚นใ‚’็”Ÿๆˆใ™ใ‚‹
  • imagesetstyle โ€” ็ทšๆ็”ป็”จใฎใ‚นใ‚ฟใ‚คใƒซใ‚’่จญๅฎšใ™ใ‚‹
  • imagesetthickness โ€” ็ทšๆ็”ป็”จใฎ็ทšๅน…ใ‚’่จญๅฎšใ™ใ‚‹
  • imagesettile โ€” ๅก—ใ‚Šใคใถใ—็”จใฎใ‚คใƒกใƒผใ‚ธใ‚’่จญๅฎšใ™ใ‚‹
  • imagestring โ€” ๆ–‡ๅญ—ๅˆ—ใ‚’ๆฐดๅนณใซๆ็”ปใ™ใ‚‹
  • imagestringup โ€” ๆ–‡ๅญ—ๅˆ—ใ‚’ๅž‚็›ดใซๆ็”ปใ™ใ‚‹
  • imagesx โ€” ็”ปๅƒใฎๅน…ใ‚’ๅ–ๅพ—ใ™ใ‚‹
  • imagesy โ€” ็”ปๅƒใฎ้ซ˜ใ•ใ‚’ๅ–ๅพ—ใ™ใ‚‹
  • imagetruecolortopalette โ€” TrueColor ใ‚คใƒกใƒผใ‚ธใ‚’ใƒ‘ใƒฌใƒƒใƒˆใ‚คใƒกใƒผใ‚ธใซๅค‰ๆ›ใ™ใ‚‹
  • imagettfbbox โ€” TypeType ใƒ•ใ‚ฉใƒณใƒˆใ‚’ไฝฟ็”จใ—ใŸใƒ†ใ‚ญใ‚นใƒˆใฎ bounding box ใ‚’็”Ÿๆˆใ™ใ‚‹
  • imagettftext โ€” TrueType ใƒ•ใ‚ฉใƒณใƒˆใ‚’ไฝฟ็”จใ—ใฆใƒ†ใ‚ญใ‚นใƒˆใ‚’็”ปๅƒใซๆ›ธใ่พผใ‚€
  • imagetypes โ€” ใ“ใฎ PHP ใŒใ‚ตใƒใƒผใƒˆใ—ใฆใ„ใ‚‹็”ปๅƒๅฝขๅผใ‚’่ฟ”ใ™
  • imagewbmp โ€” ็”ปๅƒใ‚’ใƒ–ใƒฉใ‚ฆใ‚ถใ‚ใ‚‹ใ„ใฏใƒ•ใ‚กใ‚คใƒซใซๅ‡บๅŠ›ใ™ใ‚‹
  • imagewebp โ€” WebP ็”ปๅƒใ‚’ใƒ–ใƒฉใ‚ฆใ‚ถใ‚ใ‚‹ใ„ใฏใƒ•ใ‚กใ‚คใƒซใซๅ‡บๅŠ›ใ™ใ‚‹
  • imagexbm โ€” XBM ็”ปๅƒใ‚’ใƒ–ใƒฉใ‚ฆใ‚ถใ‚ใ‚‹ใ„ใฏใƒ•ใ‚กใ‚คใƒซใซๅ‡บๅŠ›ใ™ใ‚‹
  • iptcembed โ€” ใƒใ‚คใƒŠใƒช IPTC ใƒ‡ใƒผใ‚ฟใ‚’ JPEG ใ‚คใƒกใƒผใ‚ธใซๅŸ‹ใ‚ใ“ใ‚€
  • iptcparse โ€” ใƒใ‚คใƒŠใƒชใฎ IPTC ใƒ–ใƒญใƒƒใ‚ฏใฎใ‚ฟใ‚ฐใ‚’ใƒ‘ใƒผใ‚นใ™ใ‚‹
  • jpeg2wbmp โ€” JPEG็”ปๅƒใ‚’WBMP็”ปๅƒใซๅค‰ๆ›ใ™ใ‚‹
  • png2wbmp โ€” PNG็”ปๅƒใ‚’WBMP็”ปๅƒใซๅค‰ๆ›ใ™ใ‚‹
๏ผ‹add a note

User Contributed Notes 8 notes

up
8
chuckstudios at gmail dot com ยถ
17 years ago
I wrote a simple function to convert an image resource to PGM (portable graymap) in order to feed it to an OCR program. It works just like the rest of the image output functions, and will convert to grayscale for you:

<?php
    function imagepgm($image, $filename = null)
    {
        $pgm = "P5 ".imagesx($image)." ".imagesy($image)." 255\n";
        for($y = 0; $y < imagesy($image); $y++)
        {
            for($x = 0; $x < imagesx($image); $x++)
            {
                $colors = imagecolorsforindex($image, imagecolorat($image, $x, $y));
                $pgm .= chr(0.3 * $colors["red"] + 0.59 * $colors["green"] + 0.11 * $colors["blue"]);
            }
        }
        if($filename != null)
        {
            $fp = fopen($filename, "w");
            fwrite($fp, $pgm);
            fclose($fp);
        }
        else
        {
            return $pgm;
        }
    }
?>
up
5
michal-ok at o2 dot pl ยถ
20 years ago
The image sharpen function (by Alex R. Austin) provided below seems to be very resource hungry and I couldn't make it work on two different servers - trying to sharpen a 413 x 413 image I ended up with "Fatal error: Allowed memory size of 8388608 bytes exhausted" or "Internal Server Error" or the script terminated without notice. Because I had no priviliges to change the default memory limit on these servers I started looking for other sharpen functions. I have come across a php Unsharp Mask function which works like a charm on both of the servers I dealt with. It can be found at http://vikjavev.no/hovudsida/umtestside.php.
up
4
felipensp at gmail dot com ยถ
20 years ago
Representation decimal of a color in hexadecimal for use on functions of library GD.

<?php

    // Representation hexadecimal
    $var = '#FFFFFF';

    function getRgbFromGd($color_hex) {

        return array_map('hexdec', explode('|', wordwrap(substr($color_hex, 1), 2, '|', 1)));

    }
    
    print_r(getRgbFromGd($var));

    // Output: Array ( [0] => 255 [1] => 255 [2] => 255 )

?>
up
-1
shd at earthling dot net ยถ
20 years ago
If you happen to need a way to output a Windows BMP file (e.g. when using the PEAR ExcelWriter), feel free to use the following code:

<?php
function imagebmp ($im, $fn = false)
{
    if (!$im) return false;
            
    if ($fn === false) $fn = 'php://output';
    $f = fopen ($fn, "w");
    if (!$f) return false;
            
    //Image dimensions
    $biWidth = imagesx ($im);
    $biHeight = imagesy ($im);
    $biBPLine = $biWidth * 3;
    $biStride = ($biBPLine + 3) & ~3;
    $biSizeImage = $biStride * $biHeight;
    $bfOffBits = 54;
    $bfSize = $bfOffBits + $biSizeImage;
            
    //BITMAPFILEHEADER
    fwrite ($f, 'BM', 2);
    fwrite ($f, pack ('VvvV', $bfSize, 0, 0, $bfOffBits));
            
    //BITMAPINFO (BITMAPINFOHEADER)
    fwrite ($f, pack ('VVVvvVVVVVV', 40, $biWidth, $biHeight, 1, 24, 0, $biSizeImage, 0, 0, 0, 0));
            
    $numpad = $biStride - $biBPLine;
    for ($y = $biHeight - 1; $y >= 0; --$y)
    {
        for ($x = 0; $x < $biWidth; ++$x)
        {
            $col = imagecolorat ($im, $x, $y);
            fwrite ($f, pack ('V', $col), 3);
        }
        for ($i = 0; $i < $numpad; ++$i)
            fwrite ($f, pack ('C', 0));
    }
    fclose ($f);
    return true;
}
?>

It works the same way as regular imagejpeg/imagepng do and only supports GD2.0 true colour bitmaps (which is what's required by ExcelWriter).
up
-2
delabahan at gmail dot com ยถ
9 years ago
This is an example of get high resolution images.

<?php
 /**
 * Class name      : resizeImage
 * Created by   : wang
 * Description   : This class is to resize the image from original size to new size 
 */
class resizeImage
{
     /**
     * Function name : resize_img
     * Description   : This function is to resize image 
     * @param          : $origimg variable is the original image 
     * @param          : $newimg variable is the new image 
     * @param          : $w variable is the width of image 
     * @param          : $f variable is the height of image 
     */
    public  function resize_img($origimg,$newimg,$w,$h){
        $info = getimagesize($origimg);
        $mime   = $info['mime'];

        // Make sure that the requested file is actually an image
        if(substr($mime, 0, 6) != 'image/')
        {
            header('HTTP/1.1 400 Bad Request');
            return 'Error: requested file is not an accepted type: ' .$origimg;
            exit();
        }

        // Check they extention of image
        $extension = image_type_to_extension($info[2]);
        if(strtolower($extension) == '.png'){
            $img = $this->resize_imagepng($origimg,$w, $h);
            imagepng($img,$newimg);
            imagedestroy($img);
        }elseif(strtolower($extension) == '.jpeg'){
            $img = $this->resize_imagejpeg($origimg, $w, $h);
            imagejpeg($img, $newimg);
            imagedestroy($img);
        }elseif(strtolower($extension == '.gif')){
            $img = $this->resize_imagegif($origimg, $w, $h);
            imagegif($img,$newimg);
            imagedestroy($img);
        }

    }
     /**
     * End function name : resize_img
     */

     /**
     * Function name : resize_imagepng
     * Description   : This function is to resize png image 
     * @param          : $file variable is the original image 
     * @param          : $w variable is the width of image 
     * @param          : $f variable is the height of image 
     */
    private function resize_imagepng($file, $w, $h) {
       list($width, $height) = getimagesize($file);
       $src = imagecreatefrompng($file);
       $dst = imagecreatetruecolor($w, $h);
       imagecopyresampled($dst, $src, 0, 0, 0, 0, $w, $h, $width, $height);
       return $dst;
    }
     /**
     * End function name : resize_imagepng
     */

     /**
     * Function name : resize_imagejpeg
     * Description   : This function is to resize jpeg image 
     * @param          : $file variable is the original image 
     * @param          : $w variable is the width of image 
     * @param          : $f variable is the height of image 
     */
    private function resize_imagejpeg($file, $w, $h) {
       list($width, $height) = getimagesize($file);
       $src = imagecreatefromjpeg($file);
       $dst = imagecreatetruecolor($w, $h);
       imagecopyresampled($dst, $src, 0, 0, 0, 0, $w, $h, $width, $height);
       return $dst;
    }
     /**
     * End function name : resize_imagejpeg
     */

     /**
     * Function name : resize_imagegif
     * Description   : This function is to resize gif image 
     * @param          : $file variable is the original image 
     * @param          : $w variable is the width of image 
     * @param          : $f variable is the height of image 
     */
    private function resize_imagegif($file, $w, $h) {
       list($width, $height) = getimagesize($file);
       $src = imagecreatefromgif($file);
       $dst = imagecreatetruecolor($w, $h);
       imagecopyresampled($dst, $src, 0, 0, 0, 0, $w, $h, $width, $height);
       return $dst;
    }
     /**
     * End function name : resize_imagegif
     */
}
/**
* End class name : resizeImage
*/
?>
up
-3
ingo at jache dot de ยถ
14 years ago
I know this might look somewhat superfluous to others, but i once came across a situation where i needed a *strong* blur on an image without having ImageMagick installed. Executing the convolution-filter several times on the same image is awfully slow and still doesn't give a good blur.

The function below accepts a truecolor-image and a blur-factor between 0.0 and 1.0. Beware: It's still quite slow.

<?php

    function blurImage($srcimg,$blur)
    {
        $blur = $blur*$blur;
        $blur = max(0,min(1,$blur));
    
        $srcw = imagesx($srcimg);
        $srch = imagesy($srcimg);
        
        $dstimg = imagecreatetruecolor($srcw,$srch);
    
        $f1a = $blur;
        $f1b = 1.0 - $blur;

    
        $cr = 0; $cg = 0; $cb = 0;
        $nr = 0; $ng = 0; $nb = 0;

        $rgb = imagecolorat($srcimg,0,0);
        $or = ($rgb >> 16) & 0xFF;
        $og = ($rgb >> 8) & 0xFF;
        $ob = ($rgb) & 0xFF;

        //-------------------------------------------------
        // first line is a special case
        //-------------------------------------------------
        $x = $srcw;
        $y = $srch-1;
        while ($x--)
        {
            //horizontal blurren
            $rgb = imagecolorat($srcimg,$x,$y);
            $cr = ($rgb >> 16) & 0xFF;
            $cg = ($rgb >> 8) & 0xFF;
            $cb = ($rgb) & 0xFF;
    
            $nr = ($cr * $f1a) + ($or * $f1b);
            $ng = ($cg * $f1a) + ($og * $f1b);
            $nb = ($cb * $f1a) + ($ob * $f1b);    

            $or = $nr;
            $og = $ng;
            $ob = $nb;
            
            imagesetpixel($dstimg,$x,$y,($nr << 16) | ($ng << 8) | ($nb));
        }
        //-------------------------------------------------

        //-------------------------------------------------
        // now process the entire picture
        //-------------------------------------------------
        $y = $srch-1;
        while ($y--)
        {

            $rgb = imagecolorat($srcimg,0,$y);
            $or = ($rgb >> 16) & 0xFF;
            $og = ($rgb >> 8) & 0xFF;
            $ob = ($rgb) & 0xFF;

            $x = $srcw;
            while ($x--)
            {
                //horizontal 
                $rgb = imagecolorat($srcimg,$x,$y);
                $cr = ($rgb >> 16) & 0xFF;
                $cg = ($rgb >> 8) & 0xFF;
                $cb = ($rgb) & 0xFF;
                
                $nr = ($cr * $f1a) + ($or * $f1b);
                $ng = ($cg * $f1a) + ($og * $f1b);
                $nb = ($cb * $f1a) + ($ob * $f1b);    
    
                $or = $nr;
                $og = $ng;
                $ob = $nb;
                
                
                //vertical 
                $rgb = imagecolorat($dstimg,$x,$y+1);
                $vr = ($rgb >> 16) & 0xFF;
                $vg = ($rgb >> 8) & 0xFF;
                $vb = ($rgb) & 0xFF;
                
                $nr = ($nr * $f1a) + ($vr * $f1b);
                $ng = ($ng * $f1a) + ($vg * $f1b);
                $nb = ($nb * $f1a) + ($vb * $f1b);    
    
                $vr = $nr;
                $vg = $ng;
                $vb = $nb;
                
                imagesetpixel($dstimg,$x,$y,($nr << 16) | ($ng << 8) | ($nb));
            }
        
        }
        //-------------------------------------------------
        return $dstimg;        

    }

    
    $srcimg = imagecreatefromjpeg("test.jpg");
    $dstimg = blurImage($srcimg,0.2);

    header('Content-type: image/jpeg');
    echo( imagejpeg($dstimg) );
    exit();
    
    
?>
up
-2
jeff at lushmedia dot com ยถ
22 years ago
I wrote an online overview of the image functions that people might find useful. In addition to a general overview of the various function categories and code samples, I have included many interactive examples of the functions, allowing viewers to experiment with the parameters, and seeing the results in real time. The presentation is located at New York PHP
http://www.nyphp.org/content/presentations/GDintro/
up
-4
mpyw ยถ
9 years ago
This is an example of black-and-white imagebmp() implementation. 

<?php

/**
 * Output a black-and-white BMP image to either the browser or a file.
 * 
 * @param resource $image
 *            An image resource, returned by one of the image creation functions,
 *            such as imagecreatetruecolor().
 *
 * @param string|null $to
 *            The path or an open stream resource
 *            (which is automatically being closed after this function returns)
 *            to save the file to.
 *            If not set or NULL, the raw image stream will be outputted directly.
 *
 * @param float $threshold
 *            The number in the range of 0.0 to 1.0.
 *            Brighter for larger, or darker for smaller.
 *
 * @return bool Returns TRUE on success or FALSE on failure.
 * 
 */
function imagebwbmp($image, $to = null, $threshold = 0.5)
{
    if (func_num_args() < 1) {
        $fmt = "imagebwbmp() expects a least 1 parameters, %d given";
        trigger_error(sprintf($fmt, func_num_args()), E_USER_WARNING);
        return;
    }
    if (!is_resource($image)) {
        $fmt = "imagebwbmp() expects parameter 1 to be resource, %s given";
        trigger_error(sprintf($fmt, gettype($image)), E_USER_WARNING);
        return;
    }
    if (!is_numeric($threshold)) {
        $fmt = "imagebwbmp() expects parameter 3 to be float, %s given";
        trigger_error(sprintf($fmt, gettype($threshold)), E_USER_WARNING);
        return;
    }

    if (get_resource_type($image) !== 'gd') {
        $msg = "imagebwbmp(): supplied resource is not a valid gd resource";
        trigger_error($msg, E_USER_WARNING);
        return false;
    }
    switch (true) {
        case $to === null:
            break;
        case is_resource($to) && get_resource_type($to) === 'stream':
        case is_string($to) && $to = fopen($to, 'wb'):
            if (preg_match('/[waxc+]/', stream_get_meta_data($to)['mode'])) {
                break;
            }
        default:
            $msg = "imagebwbmp(): Invalid 2nd parameter, it must a writable filename or a writable stream";
            trigger_error($msg, E_USER_WARNING);
            return false;
    }

    if ($to === null) {
        $to = fopen('php://output', 'wb');
    }

    $biWidth = imagesx($image);
    $biHeight = imagesy($image);
    $biSizeImage = ((int)ceil($biWidth / 32) * 32 / 8 * $biHeight);
    $bfOffBits = 54 + 4 * 2; // Use two colors (black and white)
    $bfSize = $bfOffBits + $biSizeImage;
    
    fwrite($to, 'BM');
    fwrite($to, pack('VvvV', $bfSize, 0, 0, $bfOffBits));
    fwrite($to, pack('VVVvvVVVVVV', 40, $biWidth, $biHeight, 1, 1, 0, $biSizeImage, 0, 0, 0, 0));
    fwrite($to, "\xff\xff\xff\x00"); // white
    fwrite($to, "\x00\x00\x00\x00"); // black
    
    for ($y = $biHeight - 1; $y >= 0; --$y) {
        $byte = 0;
        for ($x = 0; $x < $biWidth; ++$x) {
            $rgb = imagecolorsforindex($image, imagecolorat($image, $x, $y));
            $value = (0.299 * $rgb['red'] + 0.587 * $rgb['green'] + 0.114 * $rgb['blue']) / 0xff;
            $color = (int)($value > $threshold);
            $byte = ($byte << 1) | $color;
            if ($x % 8 === 7) {
                fwrite($to, pack('C', $byte));
                $byte = 0;
            }
        }
        if ($x % 8) {
            fwrite($to, pack('C', $byte << (8 - $x % 8)));
        }
        if ($x % 32) {
            fwrite($to, str_repeat("\x00", (int)((32 - $x % 32) / 8)));
        }
    }

    return true;
}
?>