تخطَّ إلى المحتوى

تحويل PDF إلى تدرّج رمادي

حوّل مستندًا ملوّنًا إلى رمادي مع إبقاء النص قابلًا للبحث.

تتم المعالجة على جهازك

تعمل هذه الأداة داخل متصفحك بالكامل. لا يُرفع ملفك أبدًا، ويمكنك التحقق من ذلك في تبويب الشبكة بمتصفحك. تحقّق بنفسك: افتح تبويب الشبكة في متصفحك وراقب. سترى طلبًا صغيرًا واحدًا يسأل إن كان لديك مهام متبقية — اسم أداة وبصمة تجزئة، وليس الملف أبدًا.

ماذا تفعل هذه الأداة

There is no way to recolour a PDF's vector content inside a browser - the colour lives in every content stream, in whichever of five colour spaces the producer chose. So this tool says plainly how it works: each page is re-rendered in grey and the document is rebuilt from the resulting images. The pages stop being vector as a result. The words do not stop being words: the text is read out first and drawn back invisibly over each image, so the document is still selectable and searchable.

The usual reason is printing. Colour pages cost several times what grey ones do on most office and copy-shop tariffs, and many print accounting systems bill by what the file contains rather than by what the driver was set to. It is also a straightforward way to shrink a colour scan.

كيف تعمل

  1. Drop the PDF onto this page. Files up to 300 MB are accepted.
  2. Set the resolution. 150 dpi is the default and reads well on screen; raise it towards 300 dpi for a document that will be printed and examined closely.
  3. Leave Keep text searchable on unless you have a reason not to - it costs a little size and keeps the document usable.
  4. Adjust the JPEG quality under advanced options if the default of 82 per cent is softer or larger than you want.
  5. Press Convert to grayscale. Progress shows which page is being rendered, and the result reports the resolution used.

The conversion uses Rec. 709 luma rather than the average of the red, green and blue channels. The eye is roughly three times more sensitive to green than to red and ten times more than to blue, so averaging makes a saturated red and a saturated blue come out as the same middle grey when one should be clearly darker. Weighting the channels the way vision does keeps coloured text, chart series and highlighted rows distinguishable after the colour is gone.

Keeping the text searchable is what separates this from printing to an image. Before any page is replaced, PDF.js extracts every text run with its position and size; those runs are then drawn over the finished image in an invisible rendering mode. You can select a paragraph, search for a phrase and copy a table out of the result, even though what you are looking at is a picture.

The file will not always get smaller. A colour scan usually shrinks substantially, because three channels become one and the JPEG has less to encode. A text document made of vector glyphs frequently grows, sometimes several times over, because a page of crisp type is cheaper to store as instructions than as a picture of itself. If your goal is size rather than colour, Compress PDF is the tool to reach for.

Because the pages are rebuilt from images, what sits on top of them does not survive: links stop being clickable, form fields stop being fillable, and comments, highlights and stamps are gone rather than drawn in. If you need the marks kept as marks, flatten the document first and convert afterwards.

Rendering happens on your device with PDF.js and a canvas, and the rebuild with pdf-lib - both in Web Workers, neither over a network. This is the heaviest tool in the category on a large file, and it is still local: a 300-page colour report is rendered page by page in your own browser.

ما لا تستطيع هذه الأداة فعله

  • The output is images, not vector pages. Zooming in far enough shows the pixels, and the type is no longer infinitely sharp.
  • A text-heavy document can come out larger than the original, because a page of type stores more cheaply as instructions than as a picture.
  • Links, form fields and annotations are not carried over, since each page is replaced by an image of itself.

أسئلة يطرحها الناس

لماذا أحوّل الملف بدل تحديد التدرّج الرمادي في نافذة الطباعة؟
لأن نافذة الطباعة لا تؤثر إلا في تلك المهمة على ذلك الجهاز وحده. أما مركز النسخ أو الطابعة المشتركة في المكتب أو زميل يفتح الملف، فكلٌّ منها سيتخذ قراره بنفسه، وكثير من أنظمة محاسبة الطباعة تحتسب الصفحة ملوّنة إن كان الملف يحتوي على لون، مهما كان ضبط التعريف. أما تحويل المستند فيحسم الأمر مرة واحدة.
كم أفقد من الجودة؟
اللون يذهب نهائيًا، وتصير الصفحات صورًا بالدقة التي تختارها. عند 150 نقطة/بوصة تُقرأ النتيجة قراءة ممتازة على الشاشة وتُطبع بشكل مقبول؛ وعند 300 تكون بجودة الطباعة ويصير الملف أكبر بنحو أربعة أضعاف. وتبقى طبقة النص محفوظة في الحالتين.
هل سيصغر الملف؟
المسح الضوئي الملوّن يصغر عادةً كثيرًا. أما المستند النصي فيكبر غالبًا، لأن رسم الحروف داخل صورة JPEG يكلّف أكثر من التعليمات التي رسمتها. وتُعرض النتيجتان كحجم قبل وبعد، فترى أيهما حصل لك وتحتفظ بالأصل إن لم يكن ما أردته.
هل أستطيع البحث في النص وتحديده بعد ذلك؟
نعم، ما دام خيار إبقاء النص قابلًا للبحث مفعّلًا. يُستخرج النص قبل استبدال الصفحات ثم يُرسم فوق الصور بشكل غير مرئي، فيظل التحديد والبحث والنسخ كلها تعمل. أما إن كان الأصل مسحًا ضوئيًا بلا طبقة نص من البداية، فلا شيء يُحفظ - شغّل أداة OCR PDF أولًا.
هل يُرفع المستند كي يُرسم؟
لا. تُرسم كل صفحة بواسطة PDF.js على لوحة داخل متصفحك أنت، وتعيد pdf-lib تجميعها في عامل ويب. لا يُرسَل شيء، وهذا يعني أيضًا أن السرعة تعتمد على جهازك لا على طابور انتظار في مكان ما.

أدوات ذات صلة