<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Pavan-Rajesh</title>
    <description>The latest articles on DEV Community by Pavan-Rajesh (@pavanrajesh).</description>
    <link>https://dev.to/pavanrajesh</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F937420%2F5e64e42a-5272-4e89-ad2e-5f235bfee986.png</url>
      <title>DEV Community: Pavan-Rajesh</title>
      <link>https://dev.to/pavanrajesh</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/pavanrajesh"/>
    <language>en</language>
    <item>
      <title>extracting RGBA values of an Image</title>
      <dc:creator>Pavan-Rajesh</dc:creator>
      <pubDate>Sun, 30 Apr 2023 11:13:30 +0000</pubDate>
      <link>https://dev.to/pavanrajesh/extracting-rgba-values-of-pixels-142l</link>
      <guid>https://dev.to/pavanrajesh/extracting-rgba-values-of-pixels-142l</guid>
      <description>&lt;p&gt;Here we will be using jimp which is a image processing library &lt;br&gt;
and fs module in Node to extract and write the values to a text file&lt;/p&gt;

&lt;p&gt;requiring the modules needed to extract and for storing the values&lt;br&gt;
&lt;code&gt;const fs = require("fs");&lt;br&gt;
const { Buffer } = require("buffer");&lt;br&gt;
const jimp = require("jimp");&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;you can install jimp as follows&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm install jimp
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;after you will need to read the image which you want to extract the rgba values&lt;/p&gt;

&lt;p&gt;here my image is named with kick.jpeg "Kick Buttowski a good cartoon right lets continue"&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;jimp.read("kick.jpeg").then((image) =&amp;gt; {
  myarray = [];
  for (let i = 0; i &amp;lt; image.bitmap.height; i++) {
    for (let j = 0; j &amp;lt; image.bitmap.width; j++) {
      myarray.push([jimp.intToRGBA(image.getPixelColour(i, j))]);
    }
  }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;lets dive into the code &lt;br&gt;
jimp.read returns a promise after you can apply many methods &lt;/p&gt;

&lt;p&gt;here we will be iterating through each and every pixel and calculate rgba using intToRGBA the we will be pushing it to the array&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;fs.createWriteStream("rgbavalues.txt").write(JSON.stringify(myarray));

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;after we will be writing the values into file called rgbvalues.txt&lt;br&gt;
here is the whole code for you here we will be using streams because the file content may be large&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const fs = require("fs");
const { Buffer } = require("buffer");
const jimp = require("jimp");
jimp.read("kick.jpeg").then((image) =&amp;gt; {
  myarray = [];
  for (let i = 0; i &amp;lt; image.bitmap.height; i++) {
    for (let j = 0; j &amp;lt; image.bitmap.width; j++) {
      myarray.push([jimp.intToRGBA(image.getPixelColour(i, j))]);
    }
  }

  fs.createWriteStream("rgbavalues.txt").write(JSON.stringify(myarray));
});
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Thanks that all for today&lt;br&gt;
Here is the pup for you&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--01Yj0aIg--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dpsmka0668h7wdkhl94m.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--01Yj0aIg--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dpsmka0668h7wdkhl94m.png" alt="Image description" width="300" height="168"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>tutorial</category>
      <category>node</category>
    </item>
    <item>
      <title>MongoDB Atlas Hackathon 2022 on DEV</title>
      <dc:creator>Pavan-Rajesh</dc:creator>
      <pubDate>Tue, 06 Dec 2022 13:04:19 +0000</pubDate>
      <link>https://dev.to/pavanrajesh/mongodb-atlas-hackathon-2022-on-dev-3chh</link>
      <guid>https://dev.to/pavanrajesh/mongodb-atlas-hackathon-2022-on-dev-3chh</guid>
      <description>&lt;h2&gt;
  
  
  What I built
&lt;/h2&gt;

&lt;p&gt;simple grocery store&lt;/p&gt;

&lt;h3&gt;
  
  
  Category Submission:
&lt;/h3&gt;

&lt;p&gt;online shop&lt;/p&gt;

&lt;h3&gt;
  
  
  App Link
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://grocerystore.onrender.com/" rel="noopener noreferrer"&gt;App Link&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Screenshots
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fablsw8zuev8r22kc77ad.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fablsw8zuev8r22kc77ad.png" alt="Image description" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjkaihpif76sxnvxw7yxn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjkaihpif76sxnvxw7yxn.png" alt="Image description" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fairo67lgb72k4y9fexgf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fairo67lgb72k4y9fexgf.png" alt="Image description" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Description
&lt;/h3&gt;

&lt;p&gt;It's a simple app which takes the available items from the database.It is also having user registration and user login pages in which the user details will be stored in database.&lt;/p&gt;

&lt;p&gt;All these things are done (storing user details and available items are done using mongodb atlas)&lt;/p&gt;

&lt;p&gt;hope you like it &lt;br&gt;
                                                   with love ---&lt;br&gt;
                                                  pavan rajesh&lt;/p&gt;

&lt;h3&gt;
  
  
  Link to Source Code
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://github.com/Pavan-Rajesh/shop-website-with-mongodb.git" rel="noopener noreferrer"&gt;Source Code&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Permissive License
&lt;/h3&gt;

&lt;p&gt;MIT&lt;/p&gt;

&lt;h2&gt;
  
  
  Background
&lt;/h2&gt;

&lt;p&gt;Basically our academics has a task to be done that is &lt;br&gt;
-- we have to build a project using mysql so I thought of doing this with mongodb and I learned lot of things while building this project&lt;/p&gt;

&lt;h3&gt;
  
  
  How I built it
&lt;/h3&gt;

&lt;p&gt;This was built using node JS,express JS framework,Ejs,Bootstrap,Mongoose&lt;/p&gt;

&lt;h3&gt;
  
  
  Additional Resources/Info
&lt;/h3&gt;

&lt;p&gt;steps need to be done to use&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;login into the page&lt;/li&gt;
&lt;li&gt;add the items which are specified in the list &lt;/li&gt;
&lt;li&gt;at last bill will be auto generated&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>watercooler</category>
    </item>
  </channel>
</rss>
