←

Photo Studio

CAREER RESULTS INDIA

Photo Studio.
Made simple.

फोटो से फॉर्म तक।
साफ़ फोटो, सही साइज, तैयार प्रिंट।

Free toolsPhoto stays on deviceNo watermark

Choose your tool

4 ESSENTIALS

01 AI Portrait Studio

व्यक्ति की फोटो के लिए। पहली बार लगभग 6 MB डाउनलोड। अपने फोन पर processing; बाल और किनारे जाँचें।

पासपोर्ट साइज फोटो शीट

पहले "बैकग्राउंड हटाएँ" टूल से फोटो साफ़ करें, फिर यहाँ सफ़ेद बैकग्राउंड चुनें। प्रिंट में "Actual size / 100%" रखें।

फोटो का साइज (px) और KB बदलें

चौड़ाई/ऊँचाई खाली छोड़ें तो साइज वही रहेगा, सिर्फ KB कम होगा।

आधार / PAN / वोटर कार्ड A4 प्रिंट

कार्ड असली साइज (8.6 x 5.4 cm) में छपेगा। फोटो पहले "डॉक्यूमेंट स्कैनर" से साफ़ कर सकते हैं।

Portrait AI: MediaPipe · Apache-2.0
General-image option: existing IMGly model. Results need manual review.

');w.document.close()} /* ---------- minimal PDF writer for sheets/cards ---------- */ function b64ToBytes(s){var b=atob(s),u=new Uint8Array(b.length);for(var i=0;i>'); obj(2,'<< /Type /Pages /Kids [3 0 R] /Count 1 >>'); obj(3,'<< /Type /Page /Parent 2 0 R /MediaBox [0 0 '+f(pw)+' '+f(ph)+'] /Resources << /XObject << /Im0 4 0 R >> >> /Contents 5 0 R >>'); obj(4,function(){add('<< /Type /XObject /Subtype /Image /Width '+iw+' /Height '+ih+' /ColorSpace /DeviceRGB /BitsPerComponent 8 /Filter /DCTDecode /Length '+jpg.length+' >>\nstream\n');add(jpg);add('\nendstream')}); obj(5,'<< /Length '+cs.length+' >>\nstream\n'+cs+'\nendstream'); var xr=len,x='xref\n0 6\n0000000000 65535 f \n';for(var i=1;i<=5;i++)x+=('000000000'+off[i]).slice(-10)+' 00000 n \n'; add(x+'trailer\n<< /Size 6 /Root 1 0 R >>\nstartxref\n'+xr+'\n%%EOF\n'); var out=new Uint8Array(len),o=0;parts.forEach(function(u){out.set(u,o);o+=u.length});return out} function linkPDF(a,cv,wmm,hmm){var jpg=b64ToBytes(cv.toDataURL('image/jpeg',0.92).split(',')[1]); var pdf=buildPDF(jpg,cv.width,cv.height,wmm,hmm); var u=URL.createObjectURL(new Blob([pdf],{type:'application/pdf'})); if(a.href&&a.href.indexOf('blob:')===0)URL.revokeObjectURL(a.href);a.href=u;a.style.display='block'; a.textContent='📄 PDF डाउनलोड ('+Math.round(pdf.length/102.4)/10+' KB)'} /* ---------- BG REMOVER: portrait fast path + preserved advanced option ---------- */ var bgFile=null,bgCut=null,bgColor='transparent',segmenter=null,aiLoad=null,aiSource=null,aiMask=null,aiBusy=false,lib=null; function clearOutput(){bgCut=null;aiSource=null;aiMask=null;['bgCv','bgDl','bgToPP'].forEach(function(id){$(id).style.display='none'});$('bgDl').removeAttribute('href')} function setMode(){clearOutput();var portrait=$('bgMode').value==='portrait';$('portraitOptions').style.display=portrait?'':'none';$('bgModeHint').textContent=portrait?'व्यक्ति की फोटो के लिए। पहली बार लगभग 6 MB डाउनलोड। अपने फोन पर processing; बाल और किनारे जाँचें।':'वस्तुओं और general images के लिए पुराना advanced मॉडल। बड़ा download (लगभग 40 MB या अधिक); पहली बार कई मिनट लग सकते हैं। इंटरनेट चाहिए, फोटो सर्वर पर नहीं भेजी जाती। चेतावनी: टेस्ट में गहरे या एक रंग वाले हिस्से हल्के और फीके आ सकते हैं। नतीजा ध्यान से देखें; पासपोर्ट या ID फोटो के लिए ऊपर Portrait चुनें।';$('bgGo').textContent=portrait?'AI portrait तैयार करें':'Advanced background हटाएँ';$('bgSt').textContent=''} $('bgMode').onchange=setMode; $('bgIn').onchange=function(e){bgFile=e.target.files[0]||null;clearOutput();$('bgGo').disabled=!bgFile;$('bgSt').textContent=''}; $('bgSw').onclick=function(e){var b=e.target.closest('button');if(!b)return;bgColor=b.dataset.c;this.querySelectorAll('button').forEach(function(x){x.classList.toggle('on',x===b)});if(bgCut)drawBg()}; function drawBg(){var cv=$('bgCv'),c=cv.getContext('2d');cv.width=bgCut.width;cv.height=bgCut.height;c.clearRect(0,0,cv.width,cv.height);if(bgColor!=='transparent'){c.fillStyle=bgColor;c.fillRect(0,0,cv.width,cv.height)}c.drawImage(bgCut,0,0);cv.style.display='block';var dl=$('bgDl');dl.href=cv.toDataURL(bgColor==='transparent'?'image/png':'image/jpeg',.95);dl.download=bgColor==='transparent'?'photo-no-bg.png':'photo-new-bg.jpg';dl.style.display='block';$('bgToPP').style.display='block'} function refine(){if(!aiSource||!aiMask)return;var c=document.createElement('canvas');c.width=aiSource.width;c.height=aiSource.height;var x=c.getContext('2d');x.drawImage(aiMask,0,0,c.width,c.height);if($('aiEdge').value==='clean'){var px=x.getImageData(0,0,c.width,c.height),d=px.data;for(var i=3;i96)visible++;if(visible<(c.width*c.height*.002))throw Error('व्यक्ति साफ नहीं मिला। चेहरे और शरीर वाली साफ फोटो चुनें, या General image मोड आज़माएँ।');x.globalCompositeOperation='source-in';if($('aiLight').checked)x.filter='brightness(1.06) contrast(1.025)';x.drawImage(aiSource,0,0);bgCut=c;drawBg()} $('aiEdge').onchange=refine;$('aiLight').onchange=refine; function loadScript(src){return new Promise(function(resolve,reject){var s=document.createElement('script'),timer=setTimeout(function(){s.remove();reject(Error('AI फाइल लोड नहीं हुई। इंटरनेट देखकर फिर कोशिश करें।'))},30000);s.src=src;s.onload=function(){clearTimeout(timer);resolve()};s.onerror=function(){clearTimeout(timer);s.remove();reject(Error('AI फाइल लोड नहीं हुई। इंटरनेट देखकर फिर कोशिश करें।'))};document.head.appendChild(s)})} async function getAI(){if(segmenter)return segmenter;if(!aiLoad)aiLoad=loadScript('/vendor/selfie/selfie_segmentation.js').catch(function(e){aiLoad=null;throw e});await aiLoad;segmenter=new SelfieSegmentation({locateFile:function(f){return '/vendor/selfie/'+f}});segmenter.setOptions({modelSelection:0,selfieMode:false});return segmenter} async function portraitCut(file,st){var image=await fileImg(file);if(image.width*image.height>60000000)throw Error('बहुत बड़ी फोटो है। छोटी फोटो चुनें।');var cv=document.createElement('canvas'),scale=Math.min(1,1200/Math.max(image.width,image.height));cv.width=Math.max(1,Math.round(image.width*scale));cv.height=Math.max(1,Math.round(image.height*scale));cv.getContext('2d').drawImage(image,0,0,cv.width,cv.height);var ai=await getAI();st.textContent='AI portrait तैयार कर रहा है…';var timer,active=true;var finished=new Promise(function(resolve,reject){timer=setTimeout(function(){active=false;reject(Error('AI में समय लग रहा है। छोटी फोटो या Chrome में कोशिश करें।'))},60000);ai.onResults(function(r){if(!active)return;active=false;clearTimeout(timer);try{aiSource=cv;aiMask=document.createElement('canvas');aiMask.width=cv.width;aiMask.height=cv.height;aiMask.getContext('2d').drawImage(r.segmentationMask,0,0,cv.width,cv.height);refine();resolve()}catch(e){reject(e)}})});try{await Promise.race([ai.send({image:cv}).then(function(){return finished}),finished])}finally{active=false;clearTimeout(timer)}} $('bgGo').onclick=async function(){if(!bgFile||aiBusy)return;aiBusy=true;clearOutput();this.disabled=true;$('bgIn').disabled=true;$('bgMode').disabled=true;var st=$('bgSt'),t=performance.now();try{if(bgFile.size>30*1024*1024)throw Error('30 MB से छोटी फोटो चुनें।');st.textContent='AI लोड हो रहा है। पहली बार इंटरनेट चाहिए…';if($('bgMode').value==='portrait'){await portraitCut(bgFile,st);st.textContent='तैयार · '+((performance.now()-t)/1000).toFixed(1)+' सेकंड। बाल/किनारे जाँचें, फिर डाउनलोड करें।'}else{if(!lib)lib=await import('https://cdn.jsdelivr.net/npm/@imgly/background-removal@1.7.0/+esm');var blob=await lib.removeBackground(bgFile,{progress:function(k,cur,tot){if(tot)st.textContent='Advanced: '+(k.indexOf('fetch')===0?'मॉडल डाउनलोड ':'प्रोसेस ')+Math.round(cur/tot*100)+'% · पहली बार कई मिनट लग सकते हैं'}});bgCut=await loadImg(URL.createObjectURL(blob));drawBg();st.textContent='तैयार। ध्यान दें: गहरे हिस्से फीके हो सकते हैं। पूरी फोटो ज़ूम करके जाँचें, फिर डाउनलोड करें।'}}catch(e){clearOutput();console.error(e);st.textContent=e.message||'नहीं हो पाया। इंटरनेट देखें या छोटी फोटो चुनें।'}finally{this.disabled=!bgFile;$('bgIn').disabled=false;$('bgMode').disabled=false;aiBusy=false}}; $('bgToPP').onclick=function(){$('bgCv').toBlob(function(b){if(!b)return;ppSet(b);document.querySelector('.tabs button[data-p=pp]').click();window.scrollTo(0,0)},'image/png')}; /* ---------- PASSPORT SHEET ---------- */ var ppImg=null,DPI=300,MM=DPI/25.4; function ppSet(f){invalidatePP();fileImg(f).then(function(i){ppImg=i;$('ppGo').disabled=false;ppPreview()})} $('ppIn').onchange=function(e){if(e.target.files[0])ppSet(e.target.files[0])}; $('ppName').onchange=function(){$('ppNameTxt').style.display=this.checked?'block':'none';ppPreview()}; ['ppSize','ppBg','ppBorder','ppZoom','ppX','ppY','ppNameTxt'].forEach(function(id){$(id).addEventListener('input',ppPreview)}); function onePhoto(){var s=$('ppSize').value.split('x'),w=Math.round(s[0]*MM),h=Math.round(s[1]*MM); var cv=document.createElement('canvas');cv.width=w;cv.height=h;var c=cv.getContext('2d'); var bg=$('ppBg').value;c.fillStyle=bg==='none'?'#fff':bg;c.fillRect(0,0,w,h); var z=$('ppZoom').value/100,sc=Math.max(w/ppImg.width,h/ppImg.height)*z,dw=ppImg.width*sc,dh=ppImg.height*sc; var ox=(w-dw)/2+($('ppX').value/100)*w,oy=(h-dh)/2+($('ppY').value/100)*h;c.drawImage(ppImg,ox,oy,dw,dh); if($('ppName').checked){var t=$('ppNameTxt').value.trim(),d=new Date().toLocaleDateString('en-GB');var bh=Math.round(h*0.14); c.fillStyle='#fff';c.fillRect(0,h-bh,w,bh);c.fillStyle='#000';c.textAlign='center';c.font='bold '+Math.round(bh*0.42)+'px sans-serif'; c.fillText(t||'',w/2,h-bh*0.52);c.font=Math.round(bh*0.34)+'px sans-serif';c.fillText(d,w/2,h-bh*0.12)} return cv} function invalidateLinks(ids){ids.forEach(function(id){var a=$(id);if(a.href&&a.href.indexOf('blob:')===0)URL.revokeObjectURL(a.href);a.removeAttribute('href');a.style.display='none'})} function invalidatePP(){invalidateLinks(['ppDl','ppPdf','ppPrint']);$('ppCv').style.display='none'} $('ppPaper').addEventListener('change',invalidatePP); function ppPreview(){invalidatePP();if(!ppImg)return;var o=onePhoto(),p=$('ppOne');p.width=o.width;p.height=o.height;p.getContext('2d').drawImage(o,0,0);p.style.display='block'} var ppMM=[152.4,101.6]; $('ppGo').onclick=function(){if(!ppImg)return;var one=onePhoto(),paper=$('ppPaper').value; var PW=paper==='a4'?210:152.4,PH=paper==='a4'?297:101.6;ppMM=[PW,PH]; var cv=$('ppCv'),W=Math.round(PW*MM),H=Math.round(PH*MM);cv.width=W;cv.height=H;var c=cv.getContext('2d');c.fillStyle='#fff';c.fillRect(0,0,W,H); var gap=Math.round(2*MM),cols=Math.floor((W-gap)/(one.width+gap)),rows=Math.floor((H-gap)/(one.height+gap)); var tw=cols*one.width+(cols-1)*gap,th=rows*one.height+(rows-1)*gap,sx=(W-tw)/2,sy=(H-th)/2,n=0; for(var r=0;r8192||h>8192||w*h>24000000){$('kbSt').textContent='⚠️ सही px साइज़ दें (1 से 8192, कुल 24 MP तक)।';return}if(+$('kbMax').value<=0||+$('kbMin').value<0||+$('kbMin').value>+$('kbMax').value){$('kbSt').textContent='⚠️ कम से कम KB, अधिकतम KB से बड़ा नहीं हो सकता।';return} var cv=document.createElement('canvas');cv.width=w;cv.height=h;var c=cv.getContext('2d');c.fillStyle='#fff';c.fillRect(0,0,w,h); var sc=Math.max(w/kbImg.width,h/kbImg.height),dw=kbImg.width*sc,dh=kbImg.height*sc;c.drawImage(kbImg,(w-dw)/2,(h-dh)/2,dw,dh); var max=(+$('kbMax').value||9999)*1024,min=(+$('kbMin').value||0)*1024,lo=0.05,hi=0.95,best=await toBlob(cv,hi); if(best.size>max){best=null;for(var i=0;i<9;i++){var q=(lo+hi)/2,b=await toBlob(cv,q);if(b.size<=max){best=b;lo=q}else hi=q}if(!best)best=await toBlob(cv,0.05)} var note='';if(best.sizemax)note=' ⚠️ इतनी KB तक नहीं आई, px साइज कम करें'; $('kbSt').textContent=(best.sizemax?'⚠️ सीमा पूरी नहीं हुई: ':'✅ नया: ')+w+'x'+h+' px, '+(best.size/1024).toFixed(1)+' KB'+note; var u=URL.createObjectURL(best);$('kbPrev').src=u;$('kbPrev').style.display='block';var dl=$('kbDl');dl.href=u;dl.style.display='block'}; /* ---------- ID CARD ---------- */ var idF=null,idB=null; function invalidateID(){invalidateLinks(['idDl','idPdf','idPrint']);$('idCv').style.display='none'} $('idCopies').addEventListener('change',invalidateID); function idChk(){invalidateID();$('idGo').disabled=!(idF||idB)} $('idF').onchange=function(e){var f=e.target.files[0];if(f)fileImg(f).then(function(i){idF=i;idChk()})}; $('idB').onchange=function(e){var f=e.target.files[0];if(f)fileImg(f).then(function(i){idB=i;idChk()})}; $('idGo').onclick=function(){var cv=$('idCv'),W=Math.round(210*MM),H=Math.round(297*MM);cv.width=W;cv.height=H;var c=cv.getContext('2d'); c.fillStyle='#fff';c.fillRect(0,0,W,H);var cw=Math.round(86*MM),ch=Math.round(54*MM),gap=Math.round(8*MM),copies=+$('idCopies').value; var top=Math.round(15*MM),left=(W-(cw*2+gap))/2; function put(img,x,y){if(!img){c.strokeStyle='#bbb';c.strokeRect(x,y,cw,ch);return}var sc=Math.max(cw/img.width,ch/img.height),dw=img.width*sc,dh=img.height*sc; c.save();c.beginPath();c.rect(x,y,cw,ch);c.clip();c.drawImage(img,x+(cw-dw)/2,y+(ch-dh)/2,dw,dh);c.restore();c.strokeStyle='#999';c.lineWidth=2;c.strokeRect(x,y,cw,ch)} for(var i=0;i