Jump to content

Search the Community

Showing results for tags 'pixelate'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • General
    • Announcements and Site News
    • Administration
  • AutoIt v3
    • AutoIt Help and Support
    • AutoIt Technical Discussion
    • AutoIt Example Scripts
  • Scripting and Development
    • Developer General Discussion
    • Language Specific Discussion
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Categories

  • AutoIt Team
    • Beta
    • MVP
  • AutoIt
    • Automation
    • Databases and web connections
    • Data compression
    • Encryption and hash
    • Games
    • GUI Additions
    • Hardware
    • Information gathering
    • Internet protocol suite
    • Maths
    • Media
    • PDF
    • Security
    • Social Media and other Website API
    • Windows
  • Scripting and Development
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Member Title


Location


WWW


Interests

Found 1 result

  1. ImagePixelate function : Func _GDIPlus_ImagePixelate ( $hImage, $iPixelBlockSize=10 ) If $iPixelBlockSize < 1 Then Return SetError ( 1, 0, 0 ) Local $iWidth = _GDIPlus_ImageGetWidth ( $hImage ) If $iPixelBlockSize > $iWidth Then Return SetError ( 2, 0, 0 ) Local $iWidthAdapted = $iWidth - Mod ( $iWidth, $iPixelBlockSize ) ; adapt size for avoid no Pixelated zone on the right side. Local $iHeight = _GDIPlus_ImageGetHeight ( $hImage ) If $iPixelBlockSize > $iHeight Then Return SetError ( 3, 0, 0 ) Local $iHeightAdapted = $iHeight - Mod ( $iHeight, $iPixelBlockSize ) ; adapt size for avoid no Pixelated zone on the bottom side. Local $hBitmap = _GDIPlus_BitmapCreateFromScan0 ( $iWidthAdapted, $iHeightAdapted ) Local $hContext = _GDIPlus_ImageGetGraphicsContext ( $hBitmap ) _GDIPlus_GraphicsDrawImageRect ( $hContext, $hImage, 0, 0, $iWidthAdapted, $iHeightAdapted ) _GDIPlus_GraphicsDispose ( $hContext ) Local $tBitmapData = _GDIPlus_BitmapLockBits ( $hBitmap, 0, 0, $iWidthAdapted, $iHeightAdapted, BitOR ( $GDIP_ILMWRITE, $GDIP_ILMREAD ), $GDIP_PXF32ARGB ) Local $iScan0 = DllStructGetData ( $tBitmapData, 'Scan0' ) Local $tPixel = DllStructCreate ( 'int[' & $iWidthAdapted * $iHeightAdapted & '];', $iScan0 ) Local $iPixelColor For $x = 0 To $iWidthAdapted - $iPixelBlockSize Step $iPixelBlockSize For $y = 0 To $iHeightAdapted - $iPixelBlockSize Step $iPixelBlockSize $iPixelColor = DllStructGetData ( $tPixel, 1, $x*$iHeightAdapted + 1 + $y ) For $i = $x To $x + $iPixelBlockSize -1 ; create pixel block with same color. For $j = $y To $y + $iPixelBlockSize -1 DllStructSetData ( $tPixel, 1, $iPixelColor, $i*$iHeightAdapted + 1 + $j ) Next Next Next Next _GDIPlus_BitmapUnlockBits ( $hBitmap, $tBitmapData ) Local $hBitmap_Scaled = _GDIPlus_ImageResize ( $hBitmap, $iWidth, $iHeight ) ; restore original size. _GDIPlus_BitmapDispose ( $hBitmap ) $tPixel = 0 $tBitmapData = 0 Return $hBitmap_Scaled EndFunc ;==> _GDIPlus_ImagePixelate() Working on an other project, i made a pause by playing with pixellated image effect. Avoid big images, it's a bit slow. Don't know if it can be usefull to someone... Sure that an unpixelate/depixelize function should be better, but it's not for today ! Just run example, it's fun. ImagePixelate Example : ImagePixelate Example.au3.html
×
×
  • Create New...