{"version":3,"file":"Dither_Archive.DbvtpV2G.mjs","names":["useRef","useMemo","__esmMin","init_npm_react_18_3_1","pe","ce","init_jsx_runtime","c","p","de","useInView","init_framer_motion_DhsWWWsN","addPropertyControls","RenderTarget","init_framer_BL70qLPA","ControlType","Dither","isOnFramerCanvas","hasImage","props","canvasRef","isInView","intensityTransformed","transformValue","animationFrameRef","lastTimeRef","elapsedTimeRef","animatedValuesRef","handleProcessImage","canvas","ctx","img","aspectRatio","targetWidth","targetHeight","imageData","brightAdjusted","DitherProcessor","adjustedThreshold","processedData","glowProcessed","err","generateRandomValue","variation","baseValue","animate","currentTime","deltaTime","newBrightness","inputMin","inputMax","inputRange","outputMin","outputMax","outputRange","result","input","clamp","init_Dither_Archive","color","varMatch","rgbMatch","rgbaMatch","hexMatch","numbers","data","factor","brightness","i","glowAmount","width","height","bgColor","backgroundColor","dotColorRgb","dotColor","y","x","idx","targetColor","threshold","errorR","errorG","errorB","bayerMatrix","dx","dy","newX","newY","newIdx"],"sources":["https:/framerusercontent.com/modules/uPkD7RNUO1vmmtMstX6i/UuMuKV94f0TLVC5yiYVK/Dither_Archive.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{ControlType,addPropertyControls,RenderTarget}from\"framer\";import{useEffect,useMemo,useRef}from\"react\";import{useInView}from\"framer-motion\";// ------------------------------------------------------------ //\n// PROPERTY CONTROLS\n// ------------------------------------------------------------ //\naddPropertyControls(Dither,{image:{type:ControlType.ResponsiveImage},algorithm:{type:ControlType.Enum,title:\"Algorithm\",options:[\"floyd-steinberg\",\"ordered\",\"random\",\"atkinson\"],optionTitles:[\"Floyd-Steinberg\",\"Ordered (Bayer)\",\"Random\",\"Atkinson\"],defaultValue:\"floyd-steinberg\"},threshold:{type:ControlType.Number,title:\"Threshold\",defaultValue:128,min:0,max:255,step:1},brightness:{type:ControlType.Number,title:\"Brightness\",defaultValue:0,min:-100,max:100,step:1},midtones:{type:ControlType.Number,title:\"Midtones\",defaultValue:50,min:0,max:100,step:1},pixelSize:{type:ControlType.Number,title:\"Pixel Size\",defaultValue:1,min:1,max:100,step:1},glow:{type:ControlType.Number,title:\"Glow\",defaultValue:0,min:0,max:50,step:1},backgroundColor:{type:ControlType.Color,title:\"Background\",defaultValue:\"#000000\"},dotColor:{type:ControlType.Color,title:\"Pixel Color\",defaultValue:\"#FFFFFF\"},animation:{type:ControlType.Object,icon:\"effect\",title:\"Animation\",controls:{enabled:{type:ControlType.Boolean,title:\"Enabled\",defaultValue:false},canvasPreview:{type:ControlType.Boolean,title:\"Preview\",defaultValue:true,hidden:props=>!props.enabled},interval:{type:ControlType.Number,title:\"Interval\",defaultValue:.1,min:.01,max:5,step:.01,unit:\"s\",displayStepper:true,hidden:props=>!props.enabled},intensity:{type:ControlType.Number,title:\"Intensity\",defaultValue:10,min:0,max:100,hidden:props=>!props.enabled}}},radius:{// @ts-expect-error - BorderRadius is not in this NPM version\ntype:ControlType.BorderRadius,defaultValue:\"0px\",title:\"Radius\"},enabled:{type:ControlType.Boolean,title:\"Enabled\",defaultValue:true}});// ------------------------------------------------------------ //\n// DEFAULT PROPS\n// ------------------------------------------------------------ //\nDither.defaultProps={algorithm:\"floyd-steinberg\",threshold:128,pixelSize:1,brightness:0,glow:0,midtones:50,radius:0,backgroundColor:\"#000000\",dotColor:\"#ffffff\",animation:{enabled:false,canvasPreview:true,interval:.1,intensity:10},enabled:true};// ------------------------------------------------------------ //\n// MAIN COMPONENT\n// ------------------------------------------------------------ //\n/**\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n * @framerIntrinsicWidth 400\n * @framerIntrinsicHeight 200\n * @framerDisableUnlink\n */export default function Dither(props){const isOnFramerCanvas=RenderTarget.hasRestrictions();const hasImage=\"image\"in props&&props.image;const canvasRef=useRef(null);const isInView=useInView(canvasRef,{once:false});const intensityTransformed=useMemo(()=>{return transformValue(props.animation.intensity,[0,100],[.001,10]);},[props.animation.intensity]);// Animation frame refs\nconst animationFrameRef=useRef(null);const lastTimeRef=useRef(0);const elapsedTimeRef=useRef(0);// Use refs instead of state for animated values\nconst animatedValuesRef=useRef({brightness:props.brightness,glow:props.glow});const handleProcessImage=()=>{if(!canvasRef.current)return;const canvas=canvasRef.current;const ctx=canvas.getContext(\"2d\",{willReadFrequently:true});if(!ctx)return;const img=new Image;img.crossOrigin=\"anonymous\";img.onload=()=>{try{// Calculate aspect ratio of original image\nconst aspectRatio=img.naturalWidth/img.naturalHeight;// Define a base resolution for consistent dithering (adjust as needed)\nconst baseResolution=800;// Calculate normalized dimensions based on pixel size and aspect ratio\nlet targetWidth,targetHeight;if(aspectRatio>=1){// Landscape or square\ntargetWidth=Math.floor(baseResolution/props.pixelSize);targetHeight=Math.floor(targetWidth/aspectRatio);}else{// Portrait\ntargetHeight=Math.floor(baseResolution/props.pixelSize);targetWidth=Math.floor(targetHeight*aspectRatio);}// Set canvas size to normalized dimensions\ncanvas.width=targetWidth;canvas.height=targetHeight;// Draw original image scaled to normalized size\nctx.imageSmoothingEnabled=false;ctx.drawImage(img,0,0,targetWidth,targetHeight);// Get image data\nconst imageData=ctx.getImageData(0,0,canvas.width,canvas.height);// Apply brightness adjustment using animated values\nconst brightAdjusted=DitherProcessor.adjustBrightness(imageData,animatedValuesRef.current.brightness);// Calculate adjusted threshold based on midtones\nconst adjustedThreshold=Math.round(props.threshold*props.midtones/50);// Apply selected dithering algorithm\nlet processedData;switch(props.algorithm){case\"floyd-steinberg\":processedData=DitherProcessor.floydSteinberg(brightAdjusted,adjustedThreshold,props.backgroundColor,props.dotColor);break;case\"ordered\":processedData=DitherProcessor.ordered(brightAdjusted,adjustedThreshold,props.backgroundColor,props.dotColor);break;case\"random\":processedData=DitherProcessor.random(brightAdjusted,adjustedThreshold,props.backgroundColor,props.dotColor);break;case\"atkinson\":processedData=DitherProcessor.atkinson(brightAdjusted,adjustedThreshold,props.backgroundColor,props.dotColor);break;default:processedData=DitherProcessor.floydSteinberg(brightAdjusted,adjustedThreshold,props.backgroundColor,props.dotColor);}// Apply glow effect using animated values\nconst glowProcessed=DitherProcessor.applyGlow(processedData,animatedValuesRef.current.glow);// Put processed image data back to canvas\nctx.putImageData(glowProcessed,0,0);}catch(err){console.error(\"Failed to process image\",err);}};img.src=props.image.src;};// Animation effect\nuseEffect(()=>{if(!props.animation.enabled||!isInView){animatedValuesRef.current={brightness:props.brightness,glow:props.glow};handleProcessImage();return;}if(isOnFramerCanvas&&!props.animation.canvasPreview){animatedValuesRef.current={brightness:props.brightness,glow:props.glow};handleProcessImage();return;}const generateRandomValue=baseValue=>{const variation=Math.abs(intensityTransformed);return baseValue+(Math.random()*2-1)*variation;};const animate=currentTime=>{if(!lastTimeRef.current){lastTimeRef.current=currentTime;}const deltaTime=currentTime-lastTimeRef.current;elapsedTimeRef.current+=deltaTime;// Check if enough time has passed based on interval\nif(elapsedTimeRef.current>=props.animation.interval*1e3){const newBrightness=generateRandomValue(props.brightness);animatedValuesRef.current={brightness:newBrightness,glow:props.glow};handleProcessImage()// Process image with new values\n;elapsedTimeRef.current=0// Reset elapsed time\n;}lastTimeRef.current=currentTime;animationFrameRef.current=requestAnimationFrame(animate);};// Start animation\nanimationFrameRef.current=requestAnimationFrame(animate);// Cleanup function\nreturn()=>{if(animationFrameRef.current){cancelAnimationFrame(animationFrameRef.current);}lastTimeRef.current=0;elapsedTimeRef.current=0;};},[props.animation.enabled,props.animation.interval,props.animation.intensity,props.animation.canvasPreview,props.brightness,props.glow,props.backgroundColor,props.dotColor,props.algorithm,props.threshold,props.pixelSize,props.midtones,isInView,props.enabled,intensityTransformed]);// Effect to handle image updates\nuseEffect(()=>{if(!hasImage)return;handleProcessImage();},[props.image,props.algorithm,props.threshold,props.pixelSize,props.midtones,props.backgroundColor,props.dotColor,hasImage,props.enabled]);const getAriaLabel=()=>{if(!props.image.alt){return`Image with ${props.algorithm} dithering applied`;}return`Dithered version of ${props.image.alt} with ${props.algorithm} dithering applied`;};if(!hasImage){return /*#__PURE__*/_jsx(\"div\",{style:{width:\"100%\",height:\"100%\",backgroundColor:\"#8855FF10\",color:\"#9966FF\",fontFamily:\"Inter\",fontSize:\"11px\",letterSpacing:\"-0.03em\",fontWeight:400,padding:\"40px\",display:\"flex\",justifyContent:\"center\",alignItems:\"center\"},children:\"Set up the component by uploading an image.\"});}return /*#__PURE__*/_jsxs(\"div\",{style:{width:\"100%\",height:\"100%\",borderRadius:props.radius,overflow:\"hidden\"},children:[!props.enabled&&/*#__PURE__*/_jsx(\"img\",{src:props.image.src,alt:props.image.alt,style:{width:\"100%\",height:\"100%\",objectFit:\"cover\"}}),/*#__PURE__*/_jsx(\"canvas\",{ref:canvasRef,style:{width:\"100%\",height:\"100%\",objectFit:\"cover\",imageRendering:\"pixelated\",opacity:props.enabled?1:0},\"aria-label\":getAriaLabel()})]});}// ------------------------------------------------------------ //\n// DITHERING ALGORITHMS\n// ------------------------------------------------------------ //\nclass DitherProcessor{// Utility function to convert hex color to RGB\nstatic hexToRgb(color){// Remove all whitespace from the color string\ncolor=color.replace(/\\s+/g,\"\");// Extract color value from var() if present\nconst varMatch=color.match(/var\\([^,]*,\\s*(.*?)\\)\\s*(?:\\/\\*|$)/);if(varMatch){color=varMatch[1].trim()// Get the color value between var(..., HERE)\n;}// Handle rgb() format with optional spaces\nconst rgbMatch=color.match(/^rgb\\((\\d+),(\\d+),(\\d+)\\)$/);if(rgbMatch){return{r:parseInt(rgbMatch[1],10),g:parseInt(rgbMatch[2],10),b:parseInt(rgbMatch[3],10)};}// Handle rgba() format with optional spaces and any decimal alpha\nconst rgbaMatch=color.match(/^rgba\\((\\d+),(\\d+),(\\d+),[\\d.]+\\)$/);if(rgbaMatch){return{r:parseInt(rgbaMatch[1],10),g:parseInt(rgbaMatch[2],10),b:parseInt(rgbaMatch[3],10)};}// Handle hex format (both with and without #)\nconst hexMatch=/^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i.exec(color);if(hexMatch){return{r:parseInt(hexMatch[1],16),g:parseInt(hexMatch[2],16),b:parseInt(hexMatch[3],16)};}// If we get here, log the problematic color for debugging\nconsole.warn(\"Could not parse color:\",color);// Try to extract numbers directly as a fallback\nconst numbers=color.match(/\\d+/g);if(numbers&&numbers.length>=3){return{r:parseInt(numbers[0],10),g:parseInt(numbers[1],10),b:parseInt(numbers[2],10)};}// Return black as last resort fallback\nreturn{r:0,g:0,b:0};}// Apply brightness adjustment to image data\nstatic adjustBrightness(imageData,brightness){const data=new Uint8ClampedArray(imageData.data);const factor=1+brightness/100;for(let i=0;i<data.length;i+=4){data[i]=Math.min(255,Math.max(0,Math.round(data[i]*factor)));data[i+1]=Math.min(255,Math.max(0,Math.round(data[i+1]*factor)));data[i+2]=Math.min(255,Math.max(0,Math.round(data[i+2]*factor)));}return new ImageData(data,imageData.width,imageData.height);}// Apply glow effect to image data\nstatic applyGlow(imageData,glowAmount){if(glowAmount===0)return imageData;const canvas=document.createElement(\"canvas\");canvas.width=imageData.width;canvas.height=imageData.height;const ctx=canvas.getContext(\"2d\",{willReadFrequently:true});// Draw original image data\nctx.putImageData(imageData,0,0);// Apply blur for glow effect\nctx.filter=`blur(${glowAmount/4}px)`;ctx.globalCompositeOperation=\"lighter\";ctx.drawImage(canvas,0,0);ctx.filter=\"none\";return ctx.getImageData(0,0,imageData.width,imageData.height);}// Floyd-Steinberg error diffusion dithering\nstatic floydSteinberg(imageData,threshold,backgroundColor,dotColor){const data=new Uint8ClampedArray(imageData.data);const width=imageData.width;const height=imageData.height;const bgColor=this.hexToRgb(backgroundColor);const dotColorRgb=this.hexToRgb(dotColor);for(let y=0;y<height;y++){for(let x=0;x<width;x++){const idx=(y*width+x)*4;// Calculate luminance\nconst luminance=Math.round(.299*data[idx]+.587*data[idx+1]+.114*data[idx+2]);// Determine which color to use based on luminance\nconst useDotColor=luminance>threshold;const targetColor=useDotColor?dotColorRgb:bgColor;// Calculate error for each channel\nconst errorR=data[idx]-targetColor.r;const errorG=data[idx+1]-targetColor.g;const errorB=data[idx+2]-targetColor.b;// Set current pixel color\ndata[idx]=targetColor.r;data[idx+1]=targetColor.g;data[idx+2]=targetColor.b;data[idx+3]=255// Alpha\n;// Distribute error to neighboring pixels\nif(x+1<width){data[(y*width+(x+1))*4]+=errorR*7/16;data[(y*width+(x+1))*4+1]+=errorG*7/16;data[(y*width+(x+1))*4+2]+=errorB*7/16;}if(y+1<height){if(x-1>=0){data[((y+1)*width+(x-1))*4]+=errorR*3/16;data[((y+1)*width+(x-1))*4+1]+=errorG*3/16;data[((y+1)*width+(x-1))*4+2]+=errorB*3/16;}data[((y+1)*width+x)*4]+=errorR*5/16;data[((y+1)*width+x)*4+1]+=errorG*5/16;data[((y+1)*width+x)*4+2]+=errorB*5/16;if(x+1<width){data[((y+1)*width+(x+1))*4]+=errorR/16;data[((y+1)*width+(x+1))*4+1]+=errorG/16;data[((y+1)*width+(x+1))*4+2]+=errorB/16;}}}}return new ImageData(data,width,height);}// Ordered/Bayer dithering\nstatic ordered(imageData,threshold,backgroundColor,dotColor){const data=new Uint8ClampedArray(imageData.data);const width=imageData.width;const height=imageData.height;const bgColor=this.hexToRgb(backgroundColor);const dotColorRgb=this.hexToRgb(dotColor);// 4x4 Bayer matrix\nconst bayerMatrix=[[0,8,2,10],[12,4,14,6],[3,11,1,9],[15,7,13,5]];for(let y=0;y<height;y++){for(let x=0;x<width;x++){const idx=(y*width+x)*4;// Convert to grayscale\nconst gray=Math.round(.299*data[idx]+.587*data[idx+1]+.114*data[idx+2]);// Get threshold modifier from Bayer matrix\nconst bayerValue=bayerMatrix[y%4][x%4];const adjustedThreshold=threshold+(bayerValue-7.5)*16;const useDotColor=gray>adjustedThreshold;const targetColor=useDotColor?dotColorRgb:bgColor;data[idx]=targetColor.r;data[idx+1]=targetColor.g;data[idx+2]=targetColor.b;}}return new ImageData(data,width,height);}// Random dithering\nstatic random(imageData,threshold,backgroundColor,dotColor){const data=new Uint8ClampedArray(imageData.data);const width=imageData.width;const height=imageData.height;const bgColor=this.hexToRgb(backgroundColor);const dotColorRgb=this.hexToRgb(dotColor);for(let y=0;y<height;y++){for(let x=0;x<width;x++){const idx=(y*width+x)*4;// Convert to grayscale\nconst gray=Math.round(.299*data[idx]+.587*data[idx+1]+.114*data[idx+2]);// Add random noise to threshold\nconst randomNoise=(Math.random()-.5)*100;const adjustedThreshold=threshold+randomNoise;const useDotColor=gray>adjustedThreshold;const targetColor=useDotColor?dotColorRgb:bgColor;data[idx]=targetColor.r;data[idx+1]=targetColor.g;data[idx+2]=targetColor.b;}}return new ImageData(data,width,height);}// Atkinson dithering\nstatic atkinson(imageData,threshold,backgroundColor,dotColor){const data=new Uint8ClampedArray(imageData.data);const width=imageData.width;const height=imageData.height;const bgColor=this.hexToRgb(backgroundColor);const dotColorRgb=this.hexToRgb(dotColor);for(let y=0;y<height;y++){for(let x=0;x<width;x++){const idx=(y*width+x)*4;// Calculate luminance\nconst luminance=Math.round(.299*data[idx]+.587*data[idx+1]+.114*data[idx+2]);// Determine which color to use based on luminance\nconst useDotColor=luminance>threshold;const targetColor=useDotColor?dotColorRgb:bgColor;// Calculate error for each channel\nconst errorR=data[idx]-targetColor.r;const errorG=data[idx+1]-targetColor.g;const errorB=data[idx+2]-targetColor.b;// Set current pixel color\ndata[idx]=targetColor.r;data[idx+1]=targetColor.g;data[idx+2]=targetColor.b;data[idx+3]=255// Alpha\n;// Distribute error using Atkinson pattern (1/8 to each neighbor)\nconst positions=[[1,0],[2,0],[-1,1],[0,1],[1,1],[0,2]];for(const[dx,dy]of positions){const newX=x+dx;const newY=y+dy;if(newX>=0&&newX<width&&newY>=0&&newY<height){const newIdx=(newY*width+newX)*4;data[newIdx]=Math.min(255,Math.max(0,data[newIdx]+errorR/8));data[newIdx+1]=Math.min(255,Math.max(0,data[newIdx+1]+errorG/8));data[newIdx+2]=Math.min(255,Math.max(0,data[newIdx+2]+errorB/8));}}}}return new ImageData(data,width,height);}}function transformValue(input,inputRange,outputRange,clamp=false){const[inputMin,inputMax]=inputRange;const[outputMin,outputMax]=outputRange;const progress=(input-inputMin)/(inputMax-inputMin);let result=outputMin+progress*(outputMax-outputMin);if(clamp){if(outputMax>outputMin){result=Math.min(Math.max(result,outputMin),outputMax);}else{result=Math.min(Math.max(result,outputMax),outputMin);}}return result;}Dither.displayName=\"Dither\";\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"Dither\",\"slots\":[],\"annotations\":{\"framerDisableUnlink\":\"\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"any-prefer-fixed\",\"framerIntrinsicWidth\":\"400\",\"framerIntrinsicHeight\":\"200\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Dither_Archive.map"],"mappings":"A,wPAgBG,SAAwBgB,EAAO,EAAM,CAAC,IAAMC,EAAiBJ,EAAa,gBAAgB,EAAQK,EAAS,UAAUC,GAAOA,EAAM,MAAYC,EAAUpB,EAAO,IAAI,EAAQqB,EAASX,EAAUU,EAAU,CAAC,KAAK,EAAK,CAAC,EAAQE,EAAqBrB,MAAoBsB,EAAeJ,EAAM,UAAU,UAAU,CAAC,EAAE,GAAG,EAAE,CAAC,KAAK,EAAE,CAAC,EAAI,CAACA,EAAM,UAAU,SAAS,CAAC,EAC3VK,EAAkBxB,EAAO,IAAI,EAAQyB,EAAYzB,EAAO,CAAC,EAAQ0B,EAAe1B,EAAO,CAAC,EACxF2B,EAAkB3B,EAAO,CAAC,WAAWmB,EAAM,WAAW,KAAKA,EAAM,IAAI,CAAC,EAAQS,MAAuB,CAAC,GAAG,CAACR,EAAU,QAAQ,OAAO,IAAMS,EAAOT,EAAU,QAAcU,EAAID,EAAO,WAAW,KAAK,CAAC,mBAAmB,EAAI,CAAC,EAAE,GAAG,CAACC,EAAI,OAAO,IAAMC,EAAI,IAAI,MAAM,EAAI,YAAY,YAAY,EAAI,WAAW,CAAC,GAAG,CACtT,IAAMC,EAAYD,EA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