{"id":19433078,"url":"https://github.com/pariazar/filepix","last_synced_at":"2026-03-03T06:36:36.063Z","repository":{"id":64227741,"uuid":"574255769","full_name":"pariazar/filepix","owner":"pariazar","description":"convert the images into a different format","archived":false,"fork":false,"pushed_at":"2023-05-29T22:06:50.000Z","size":491,"stargazers_count":7,"open_issues_count":5,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-06T04:33:33.932Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pariazar.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-12-04T22:13:35.000Z","updated_at":"2025-07-31T11:06:18.000Z","dependencies_parsed_at":"2024-11-10T14:42:11.578Z","dependency_job_id":null,"html_url":"https://github.com/pariazar/filepix","commit_stats":{"total_commits":23,"total_committers":1,"mean_commits":23.0,"dds":0.0,"last_synced_commit":"08827cac658a31d20ccf563cb987b3b130266ace"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/pariazar/filepix","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pariazar%2Ffilepix","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pariazar%2Ffilepix/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pariazar%2Ffilepix/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pariazar%2Ffilepix/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pariazar","download_url":"https://codeload.github.com/pariazar/filepix/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pariazar%2Ffilepix/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30034121,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-03T06:09:21.518Z","status":"ssl_error","status_checked_at":"2026-03-03T06:08:47.858Z","response_time":61,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-10T14:38:26.753Z","updated_at":"2026-03-03T06:36:36.049Z","avatar_url":"https://github.com/pariazar.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# FilePix\n[![npm](https://img.shields.io/npm/v/filepix.svg?style=flat-square)](https://www.npmjs.com/package/filepix)\n![building workflow](https://github.com/hamedpa/filepix/actions/workflows/nodejs.yml/badge.svg)\n\u003ccenter\u003e \u003cimg src=\"./img/cover.png\" /\u003e\u003c/center\u003e\n\n\u003cp class=\"lead\"\u003epowerful image converter package, it can convert images into a different formats, it includes below features:\u003c/p\u003e\n\n* [convert pdf to word document](#convert-pdf-to-word-document)\n* [convert images into a single pdf file](#convert-images-to-pdf)\n* [convert pdf to multiple image file](#convert-pdf-to-images)\n* [convert png to jpg](#convert-png-to-jpg)\n* [convert base64 to jpg or png](#base64-to-jpg-or-png)\n* [compress image files](#convert-png-to-jpg)\n* [add watermarks or extra effects to your image files](#add-effects)\n\n\u003chr\u003e\n\n## Installation\nInstall via NPM:\n\n```bash\nnpm install filepix\n```\n\u003cp class=\"lead\"\u003eThen you can \u003cstrong\u003erequire\u003c/strong\u003e or \u003cstrong\u003eimport\u003c/strong\u003e as usual:\u003c/p\u003e\n\n```javascript\nconst filepix = require(\"filepix\");\n```\n```typescript\nimport * as filepix from \"filepix\";\n```\n\u003chr\u003e\n\n## Convert images to PDF\n\nthis feature let you convert your images into a single pdf file\n\u003ch3\u003eBasic Usage\u003c/h3\u003e\n\u003cp class=\"lead mb-5\"\u003eif you want to convert all images inside a specific directory you can use below code:\n\u003c/p\u003e\n\u003cp class=\"lead mb-10\"\u003e\u003ccode\u003epages\u003c/code\u003e: images directory path\u003c/br\u003e\n  \u003ccode\u003esource\u003c/code\u003e: output for saving final PDF file\n\u003c/p\u003e\n\n\n\n```javascript\nfilepix.img2PDF(pages = './inputImagesDir', output = \"./outputImageDir/output.pdf\");\n```\nor maybe your images file in different path for this case you can use below code:\n\n```javascript\nfilepix.img2PDF(\n  pages = [\n        './1.jpg',\n        './public/upload/2.jpg',\n        './public/upload/example/3.jpg'\n  ],\n  output = \"./outputImageDir/output.pdf\");\n```\n\n### Add effects\n\n\u003cp class=\"lead mb-5\"\u003eadd easily a lot of effect to your images while converting to pdf\n\u003c/p\u003e\nadd effect to your final pdf by set some options.\n\n#### Color\nApply multiple color modification rules\n\n```javascript\nlet options = {\n   effects: [\n              {\n                  name: 'color',\n                  config: [{ apply: 'green', params: [100] }]\n              }\n            ]\n  };\nfilepix.img2PDF(pages = './inputImagesDir', output = \"./outputImageDir/output.pdf\", options);\n```\n\n#### Flip\nFlip the image horizontally or vertically. Defaults to horizontal.\n```javascript\nlet options = {\n   effects: [\n              {\n                  name: 'mirror'\n              }\n            ]\n  };\n\n```\n```javascript\nlet options = {\n   effects: [\n              {\n                name: 'flip',\n                config: {\n                    vertical: true\n                }\n              }\n            ]\n  };\nfilepix.img2PDF(pages = './inputImagesDir', output = \"./outputImageDir/output.pdf\", options);\n```\n#### Blur\nA fast blur algorithm that produces similar effect to a Gaussian blur\n```javascript\nlet options = {\n   effects: [\n              {\n                name: 'blur',\n                config: {\n                    pixels: 50\n                }\n              }\n            ]\n  };\n```\n#### Rotate\nRotates the image clockwise by a number of degrees. By default the width and height of the image will be resized appropriately.\n```javascript\nlet options = {\n   effects: [\n              {\n                name: 'rotate',\n                config: {\n                    ratio: 45\n                }\n              }\n            ]\n};\n```\n#### Brightness\n```javascript\nlet options = {\n   effects: [\n              {\n                name: 'brightness',\n                config: {\n                    ratio: 0.1\n                }\n              }\n            ]\n};\n```\n#### Contrast\n```javascript\nlet options = {\n   effects: [\n              {\n                name: 'contrast',\n                config: {\n                    ratio: 0.2\n                }\n              }\n            ]\n  };\n```\n#### Gaussian\n\n```javascript\nlet options = {\n   effects: [\n              {\n                name: 'gaussian',\n                config: {\n                    ratio: 2\n                }\n              }\n            ]\n};\n```\n\n#### Posterize\n```javascript\nlet options = {\n   effects: [\n              {\n                name: 'posterize',\n                config: {\n                    ratio: 100\n                }\n              }\n            ]\n};\n```\n#### Opacity\n```javascript\nlet options = {\n   effects: [\n              {\n                name: 'opacity',\n                config: {\n                    ratio: 0.1\n                }\n              }\n            ]\n};\n```\n### Sepia\n```javascript\nlet options = {\n   effects: [\n              {\n                name: 'sepia'\n              }\n            ]\n};\n```\n\n#### Quality\n```javascript\nlet options = {\n   effects: [\n              {\n                name: 'quality',\n                config: {\n                    ratio: 10\n                }\n              }\n            ]\n};\n```\n#### Fade\n```javascript\nlet options = {\n   effects: [\n              {\n                name: 'fade',\n                config: {\n                    ratio: 0.1\n                }\n              }\n            ]\n};\n```\n#### Pixelate\n```javascript\nlet options = {\n   effects: [\n              {\n                name: 'pixelate',\n                config: {\n                    ratio: 50\n                }\n              }\n            ]\n};\n```\n#### Normalize\n```javascript\nlet options = {\n   effects: [\n              {\n                name: 'normalize',\n                config: {\n                    ratio: 50\n                }\n              }\n            ]\n};\n```\n#### Threshold\n```javascript\nlet options = {\n   effects: [\n              {\n                name: 'threshold',\n                config: { max: 200, replace: 200, autoGreyscale: false }\n              }\n            ]\n};\n```\n#### multiple effects\nyou can combine effects by using below code:\n```javascript\nlet options = {\n   effects: [\n            {\n                name: 'quality',\n                config: {\n                    ratio: 10\n                }\n            },\n            {\n                name: 'contrast',\n                config: {\n                    ratio: 0.2\n                }\n            },\n            {\n              name: 'threshold',\n              config: { max: 200 }\n            }\n          ]\n};\n```\n### Add watermarks\nyou can add watermark to all images and merge them as single pdf by set below option\npath: watermark image path\nposition: watermark position (center,right,right-bottom,center-bottom,left-top,left-bottom)\n\n```javascript\noptions = {\n  watermark: {\n            type: 'image',\n            path: '../logo1.jpg',\n            ratio: 0.2,\n            opacity: 0.2,\n            position: 'left-bottom'\n  }\n}\n```\n\u003chr\u003e\n\n## Convert pdf to images\n\nthis feature let you convert your pdf into multiple images.\n\u003ch3\u003eBasic Usage\u003c/h3\u003e\n\n```javascript\nfilepix.PDF2img('./inputImagesDir/input.pdf', \"./outputImageDir\");\n```\n\u003chr\u003e\n\n## Convert pdf to word document\n\n\n\n\u003e **_NOTE:_**  this method using OCR so first, you need to install the Tesseract project. Instructions for installing Tesseract for all platforms can be found on [the project site](https://github.com/tesseract-ocr/tessdoc/blob/master/Installation.md).\n\nafter installing Tesseract you can easily convert your pdf into file as docx format by calling below code:\n```javascript\nawait filepix.pdf2docx('./inputImageDir/input.pdf', './outputImageDir/output.docx');\n```\n\n#### Custom Language\n\n1- find your LangCode from \u003ca href=\"https://tesseract-ocr.github.io/tessdoc/Data-Files-in-different-versions.html\" target=\"_blank\"\u003ehere\u003c/a\u003e\u003c/br\u003e\n2- download proper .traineddata file from \u003ca href=\"https://github.com/tesseract-ocr/tessdata\" target=\"_blank\"\u003ehere\u003c/a\u003e and copy it on your local machine in Tesseract-OCR/tessdata  directory\u003c/br\u003e\n3- finally use below code:\u003c/br\u003e\n\n```javascript\nawait filepix.pdf2docx('./inputImageDir/input.pdf', './outputImageDir/output.docx',  options = { lang: \"deu\" });\n```\n\u003chr\u003e\n\n## Convert png to jpg\n\nconvert png format into jpg even you can compress your image.\n\n```javascript\nawait filepix.png2jpeg('./input.png', './output.jpg'\n, options = {\n  quality: 50\n});\n```\n\u003chr\u003e\n\n## base64 to jpg or png\n\nconvert base64 to png or jpg by calling below method.\n\n```javascript\nawait filepix.base64ToImg('base64Str', './outputImageDir/output.png', { extension: 'png' });\n```\n\u003chr\u003e\n\n## Support\n  - [Bug Reports](https://github.com/hamedpa/filepix/issues/)\n\n## Contributors\n\u003cp\u003e\nPull requests are always welcome! Please base pull requests against the main branch and follow the contributing guide.\n\nif your pull requests makes documentation changes, please update readme file.\n\u003c/p\u003e\n\n## License\n\nThis project is licensed under the terms of the\nMIT license\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpariazar%2Ffilepix","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpariazar%2Ffilepix","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpariazar%2Ffilepix/lists"}